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
Why string is not thread safe?
What is the purpose of the system class in java programming?
What is the use of default method in interface in java? Explain
What is jit compiler ?
What happens if main method is not static?
What will happen to the exception object after exception handling?
What is object data type?
What are access specifiers available in java?
Is null keyword in java?
Do I need to import java.lang package any time? Why?
How will you add panel to a frame?
What does s mean in regex?
What are the three parts of a lambda expression? What is the type of lambda expression?
What is an inner class in java?
How would you convert bytes to string?