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 |
how can u cal servlet from java?
What is the purpose of the wait() method?
what are the advantages of JTA over JTS?
How many ways can a thread be used?
What happens when we invoke a thread?s interrupt method while it is in sleeping or waiting condition?
What is the purpose of the notify() method?
Explain phantom read?
How u validate date in DD/MM/YY format. and how u validate money in ur jsp
3 Answers Ashok Leyland, Satyam, Tech Mahindra, Tomax,
if i know the lenght of collection in hand, should I use Array or Arraylist? justify
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
What method is used to create the daemon thread?
What are the different types of exception?