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 / kuldeep

yes it is possible in java but jvm call only one main()
method. for eg.

class test
{
public static void main(String []ar)
{
System.out.println("his is 1 st main() method");
}

public static void main(String ar[],String []st)
{
System.out.print("overloaded main() method");
}
}

but o/p of this program is: 1st main() method statement is
display. but why its ans. is at complile time String ar
argument contain one argument it is class name for making a
class file or byte code file. 2 arg store the one class
name it is not possible

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of tostring() method in java?

1232


Is java a digit method?

1041


What is a copy constructor in java?

1198


what is the final keyword denotes in java?

1159


What are mutable classes?

1129


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

1011


What is flag in java?

1046


Does java linked list allow duplicates?

1021


Do we need to manually write Copy Constructor?

1088


Is there any difference between synchronized methods and synchronized statements?

1139


What is the use of default method in interface in java? Explain

1047


What is substring 1 in java?

1235


Explain the differences between abstraction and encapsulation?

1105


What is 16 bits called?

986


How many java versions are there?

1117