why we use main in java?

Answer Posted / amit

look guys,we use main() method inside java cause whenever we
compile .java file then jvm call classname.main() first
without make any object.main method must be public and static
cause public for wide accessing and jvm call main() without
creating any object its only possible when main() is static
method.and all the argument taken by main in form of string
thats why we write as.......
public static void main(String args[])
it canbe
public final static void main(String args[])

Is This Answer Correct ?    24 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different algorithms used for clustering?

835


Is infobus easy to use?

823


Can you control when passivation occurs?

842


Difference between swing and awt?

881


Why won’t the jvm terminate when I close all the application windows?

1014


Can constructors be synchronized in java?

881


In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2460


What are the different class loaders used by jvm?

854


Explain the different types of memory used by jvm?

897


Define prototype?

839


What is a class loader?

1064


What do you mean by Socket Programming?

817


How would you detect a keypress in a jcombobox?

917


If your ui seems to freeze periodically, what might be a likely reason?

809


What class is the top of the awt event hierarchy?

860