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...

In Java why we write public static void main(String args[])
why not main()?

Answer Posted / srinivas_cena

public- public isa access specifier,so we can use the method from out the class
static- static is a keyword which is used to calla methos with out creation of object for a class. so jvm directly runs from main() method.
void- main() method does not return any value so it has void data type.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between throw and throws?

1155


How is it possible for two string objects with identical values not to be equal under the == operator?

1031


Is a method a function?

1093


What are different data structures in java?

1081


What is operator overloading. Is it is supported in java?

1081


If a class is declared without any access modifiers, where can the class be accessed?

1103


How you can force the garbage collection?

1029


How to create an interface?

1125


If you are given the name of the function at run time how will you invoke the function?

1186


When should I use singleton pattern?

1082


Can we extend singleton class?

994


Explain what access modifiers can be used for variables?

1107


Write a program to search a number in the given list of numbers.

1076


What is try-with-resources in java?

1217


Why object class is super class for every class in java?

1080