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

What is jboss?

0 Answers  


whats is mean by object and class?

1 Answers   Saka Solutions,


advantage of thread?

3 Answers   HCL,


Difference Between getRequest and PostRequest?

8 Answers   HCL, TCS,


What is meant by method chaining?

0 Answers  






What is Connection Pooling?

1 Answers   Enteg Technologies, Infosys, Polaris,


Name the method to find, if a thread is active or not?

2 Answers  


Explain the methods of Naming class, rebind( ) and lookup()?

1 Answers  


whats is mean by tiles in struts

0 Answers   SolutionNET,


list the types of dialodg

1 Answers   Wipro,


What are synchronized methods and synchronized statements?

2 Answers   Adobe,


What is rmic?

4 Answers  


Categories