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

If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?

808


What is in-memory replication?

786


Write a program to show synchronization?

891


what are memory considerations of jsp compares to other web components?

6279


What is the form of storage space in java?

1986


Why use a datasource when you can directly specify a connection details?

788


What is the infobus?

822


What is ioc concept & explain it?

842


wahts is mean by dynavalidatorform in struts/

1812


which type of objects reference will be given to client?

2275


Is the ternary operator written x : y ? Z or x ? Y : z ?

869


How can I avoid validating a form before data is entered?

757


What is the difference between RMI registry and OS Agent?

888


What is the relation between the infobus and rmi?

785


What are the services in RMI ?

2100