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

Answer Posted / sahithi

Main method is entry point of our program.It is the method
executed when we run java program.

The method is "public" becozit should be accesible to jvm
to begin execution of program.

It is "static" becoz it should be available for execution
without an object instance..

String args[] are used to signify that user may pass
parameters to java prgm in commandline

Is This Answer Correct ?    19 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If two threads have same priority which thread will be executed first ?

839


Which is better stringbuilder or stringbuffer?

524


What is local class in java?

514


Can we overload the main() method?

545


Define locale.

582






Can we override the overloaded method?

558


What are mutable classes?

519


What is the difference between a switch statement and an if statement?

511


How do you declare a destructor in java?

497


What is the difference between @before and @beforeclass annotation?

528


Where is core java used?

572


Write a program to reverse a number in java?

556


How are destructors defined in java?

567


Which language is java?

538


Can a class have multiple superclasses?

561