Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can u overload main()method.Give with example.

Answer Posted / tushar

class Checkmain
{

public static void main(String args[])
{
System.out.println("helloCheckmain string main ");
}
}

class Checkmain1 extends Checkmain
{
public static void main(String args[])
{
System.out.println("helloCheckmain1 string main ");
}
}

public class Main
{
public static void main(String args[])
{
String S[]=new String[10] ;
System.out.println("******string main**********");
int q=10;
main(q);
Checkmain.main(S);
Checkmain1.main(S);
}

public static void main(int a
{
String S[]=new String[10] ;
System.out.println("000000000 int main 0000000000");
Checkmain.main(S);
Checkmain1.main(S);
}
}

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort in descending order in java using collections sort?

884


Are primitives objects?

1046


How is java hashmap implemented?

1020


What is meant by method overriding?

1105


What is jvm? How its run?

1075


What is public static void main?

1094


how can i use a nonsynchronized hashtable?

2565


What is the difference between stored procedure & function?

961


What is generic class?

1090


Can you declare the main method as final?

1006


What does replaceall do in java?

907


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

976


Can we inherit a class with private constructor?

1118


Explain static nested classes ?

1109


How do you write a scanner class in java?

1011