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 / kanchan bangar

In java if we are not writting public static void main
(String args[]) then program is only compield not run
that's why it must write because compiler in java always
look the main function and when compiler always calls the
main class is loaded in frist time call for that static
keyword is used and public is for access everything means
methods and member variabls of any pakage and classes or in
super class and meand it does not return any value.

Is This Answer Correct ?    18 Yes 57 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you have two constructors in java?

897


Can we inherit a class with private constructor?

1058


What is stored procedure. How do you create stored procedure ?

1889


Can you use this() and super() both in a constructor?

929


Is linkedlist thread safe in java?

940


What is hashmap and map?

957


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

1267


What is classpath?

954


What is a lock or purpose of locks in java?

971


Why local variables are stored in stack?

920


Can a class have more than one object?

935


How would overload a function based on return type?

918


What is map and hashmap in java?

1025


How do you do a line break in java?

932


What is the list interface in java programming?

1037