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 we overload main method?

Answer Posted / srinivaskumar.nimmana

Yes, we can... like this,

public static void main(String[] args){....}
pulbic void main(int a){....}
public static int main(flaot f){....}
public String main(string s){....}

in the above code public static void main(string[] args) executed as thread remaining methods are normal methods in our java class. in jvm p.s.v.main(string[] args) defined with thread so jvm always search for this syntax only.any other main() with diffrent parameters are consider as normal method

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a finally block?

988


what is bmg file and how to create that files?what will it contailn?

2355


What is the use of static class?

1194


What are the topics in advance java?

972


What does the @override annotation do?

1044


Is there a case when finally will not execute?

1012


What is string variable?

1060


Why do we need singleton?

973


What is the synonym of string?

1095


Why is java multithreaded?

998


Which of the classes will have more memory allocated?

980


Can we create constructor in abstract class ?

1065


How does finally block differ from finalize() method?

1052


Is singleton a bad practice?

1059


Detail discussions on JVM, memory management and garbage collector.

988