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

Answer Posted / ravi

static because once the class is loaded the main() will be
invoked first.
void because main()is not returning any value.

Is This Answer Correct ?    228 Yes 99 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?

563


placement papaers of spring computing technology

1027


What is the purpose of the finalize() method?

717


What are operators and its types?

578


What is main string [] args?

522






What is float in java?

565


What is the difference between a scrollbar and a scrollpane?

567


How to solve the problem of generating the unique hash keys with hash function?

1463


What is the difference between serializable and externalizable interface?

570


How many unicode characters are there?

560


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

633


What is difference between final and immutable?

563


What are the differences between abstract class and interface?

515


Is 0 an irrational number?

609


What are the differences between this and super keyword?

534