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

Can a constructor call the constructor of parent class?

541


what is meant by HQL?

643


Can we create more than one object singleton class?

585


How does linkedhashmap work in java?

519


Tell us something about set interface.

564






How do you implement singleton class?

518


What is a hashmap used for?

650


Where can I find jdk in my computer?

468


Is a method a procedure?

559


Discuss different types of errors that generally occur while programming.

581


What if static is removed from main method?

575


What is a module function?

557


Hi.... I applied for the post of scientific officer/Engineer-SB(Programmer).Please post the syllabus and sample papers.

1509


What is string manipulation?

498


what are the high-level thread states? : Java thread

562