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()?

Answers were Sorted based on User's Feedback



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

Answer / alok nayak

a

Is This Answer Correct ?    0 Yes 0 No

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

Answer / sai kiran varma

In java main() is a default calling funtion.
first main() function is called.
As we dont no what value it returns we use void keyword for it.
only static methods can be called using class names so we
declare static.
only public methods can be accessed from any where so,we use
public..

Is This Answer Correct ?    0 Yes 3 No

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

Answer / lotus

as compiler needs to enter inside a program to compile so
public is used and static is used to help the main method
to be invoked without an object.

Is This Answer Correct ?    3 Yes 7 No

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

Answer / sreenu karampudi

public static void main(String args[])

When the class get loaded, it will execute the static main
() method. void as it does not return anything.

Is This Answer Correct ?    15 Yes 49 No

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

Answer / 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

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

Answer / ivan

Because in java every thing we enter is accepted as a
string.

Is This Answer Correct ?    73 Yes 163 No

Post New Answer

More Core Java Interview Questions

Difference between prefix and postfix forms of the ++operator?

3 Answers  


Can we override constructors in java?

0 Answers  


What does sprintf mean?

0 Answers  


What is default specifier ??? Use of default specifier ???

4 Answers   Cognizant, Syntel,


What are keywords and reserved words in java?

0 Answers  


Why array is used in java?

0 Answers  


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

0 Answers  


what is difference between colection and collections?

25 Answers   Amdocs, IBM, Infosys, Ipog Software, Polaris, Tech Mahindra,


What is collection class in java?

0 Answers  


What is an example of a conditional statement?

0 Answers  


where can we get jAVA project orientation traing in HYDERABD

0 Answers  


What’s the difference between the methods sleep() and wait()?

0 Answers  


Categories