what is purpose of writting public static void main(Strind
arg[]) in java..?

Answer Posted / jyotshna pardhia

public: to call by jvm from anywhere.(i.e. suppose ur
programms are saved in d drive and jdk is installed in e
drive so we can call by jvm from any drive )
static: without creating objects also jvm has to call this
method.
void: main() method never returns anything to jvm.
main: name of this method which is configured as main
only,inside the jvm by sun.
String []args: command line arguments.

if we are performing any changes to this main method than
we will get run time exception but still we can add
identifiers like strictfp and synchronized to main method.

Thanks & Regards
jyotshna

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function and method in java?

516


Can we make main() thread as daemon?

568


What is the difference between the size and capacity of a vector?

561


Why does java not allow multiple public classes in a java file ?

3429


What is return in java?

548






What is n in java?

535


How can we achieve thread safety in java?

679


When should I use singleton pattern?

537


What does escaping a character mean?

528


Can a static method be final?

548


What is application tier?

523


What is rmi and steps involved in developing an rmi object?

559


What restrictions are placed on method overriding?

634


What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?

1931


Tell us something about an iterator.

544