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 does g mean in regex?

760


How can you add and remove nodes in jtree?

828


This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

771


How do you create a first line indent?

751


Write java program to reverse string without using api?

769


How can we access some class in another class in java?

784


What are data types in oop?

803


What is a java list?

833


What are computer functions?

722


How does regex work?

756


What do you mean by synchronized non access modifier?

772


Is binary a low level language?

714


Why do we use bufferedreader?

756


Explain about class in java?

864


What is functional interface in javatpoint?

747