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 a flag and how does it work?

1010


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

1156


How do you reverse a word in java?

1083


Can we change the value of static variable?

961


What is the benefit of abstract class?

950


Are floats faster than doubles?

1064


What is the purpose of garbage collection in java, and when is it used?

1043


How does singleton class work?

994


Is string a class in java?

989


What is a concrete classes? Is Java object class is concrete class?

984


What are singleton services?

918


How many bits is a string?

1007


Differentiate between a constructor and a method? Can we mark constructors final?

1201


Does apple use java?

957


What is assembly condition codes?

992