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
Can a final variable be initialized in constructor?
What is final keyword in java? Give an example.
What is the purpose of the runtime class in java programming?
What is hashmap and map?
How many bits are in a sentence?
How many functional interfaces does java 8 have?
Why object class is super class for every class in java?
What is meant by bytecode?
What are the uses of synchronized keyword?
Can I declare a class as private?
What are classloaders?
How infinite loop is declared?
Is java an open source?
What is the purpose of garbage collection in java, and when is it used?
What is a numeric digit?