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

Answer Posted / abhi

it is bcoz...
since MAIN is also a method and it is not called by creating instance it is declared STATIC so that it is invoked by the JVM without creating instance.....

PUBLIC because it is called by the jvm which is not is not a part of the class directly.....

VOID because it does not return any value.....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is JDBC Driver interface?How can you retrieve data from the ResultSet

1513


Explain creating threads by extending thread class ?

580


How do you detect memory leaks?

584


How many bytes is a string?

565


What is tree node in java?

528






Why do we need singleton class?

551


Can we declare an array without size in java?

524


Explain about oops concepts.

636


Which sorting algorithm is in place?

535


Explain about the performance aspects of core java?

556


What is difference between this and super keyword?

519


What is jrmp?

550


What is the use of object and class classes?

569


what is singleton in java?

601


What are the 4 types of characters?

545