why we use main in java?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / poojadayal1989
we are using main in java bcoz its entry point of all
program..bcoz of static it can execute first.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / suribabu
the program execution starts from the main()method.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sri
application begin execution by calling main() method of
that class
| Is This Answer Correct ? | 3 Yes | 8 No |
Difference between JRE and JVM?
3 Answers HeadStrong, Infotech,
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?
what is domain,give me some brief information about that?
can we write implementation for a method with in another method?
difference between sql exception class and sql warning class
What is the return type of interrupt method?
can a static method be overridden
What is Stream and Types?
What is a policy?
Write a java program to find out the sum of harmonic series : 1 + ½ + 1/3 + ……… up to nth term , for any value of n.
What are the services in RMI ?
Will the general public have access to the infobus apis?