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 / manik kumar bardhan

public means access specifier
static means
in general we always start execution from main()
but in java main() exist with in a class so when ever we r
executing any method which r within the class we need
instance variable to execute that method(a.print()) but here
without creating any instance main method will execute first
b/c static is the keyword which used for method then method
become a associated with class.for execution of that method
no need create instance.
void :return type
main is the method where java compiler starts execution.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there a way to increase the size of an array after its declaration?

995


Does java runtime require a license?

979


What is flush () in java?

946


What is the range of a character variable?

930


What causes memory leaks in java?

869


What is intern method in java?

1021


Distinguish between a predicate and a function?

938


What is difference between an object and a class?

1068


Which methods are used during serialization and deserialization process?

943


How do you sort a string in alphabetical order in java?

870


What does s mean in regex?

950


Can we use this () and super () in a method?

925


What java ide should I use?

931


Where local and global variables are stored?

1039


Why string is not a wrapper class?

1132