why we use main in java?

Answers were Sorted based on User's Feedback



why we use main in java? ..

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

why we use main in java? ..

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

why we use main in java? ..

Answer / suribabu

the program execution starts from the main()method.

Is This Answer Correct ?    2 Yes 0 No

why we use main in java? ..

Answer / sri

application begin execution by calling main() method of
that class

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More Advanced Java Interview Questions

difference between sql exception class and sql warning class

1 Answers  


How to determine SGA site?

0 Answers   Wipro,


What is the name of the state, when a thread is executing?

4 Answers  


What class is the top of the awt event hierarchy?

0 Answers  


What is RPC?

2 Answers  


How to send a request to garbage collector?

3 Answers  


In a multitiered application which tier is the browser in?

3 Answers   Adobe,


What are the types of scaling?

0 Answers  


In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?

0 Answers  


what is a portable component?

0 Answers  


What is rmic?

4 Answers  


How to pass parameters in RMI?

0 Answers  


Categories