Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / srinivas nallavelli

public-> it must be available to jvm
static-> to use without instantiation
void-> does not return any thing
String[] args -> to take every variable as string
..through cmmand line arguements

Is This Answer Correct ?    17 Yes 1 No

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

Answer / 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

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

Answer / chandrakala

without placing "public",the program cannot be
executed..static is used becoz JVM's first priority will be
always given to static itself..so that without depending on
the object,we must execute the program.void main it used becoz
it wont allow returning any value.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

In java, how many ways you can take input from the console?

0 Answers  


what is generics in jdk1.5?

2 Answers   Bally Technologies,


How to write custom exception in java?

0 Answers   Cyient,


What is purpose of applet programming?

0 Answers  


1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual words of the sentence. 4) Reverse string without using temp string.

2 Answers   HCL,


What are the uses of java?

0 Answers  


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

0 Answers  


Is java ee a framework?

0 Answers  


Explain about static nested classes in java?

0 Answers  


What is the differenc between Enemuration interface and iterator interface according to accessing?

4 Answers  


What is the use of conditional statement?

0 Answers  


What is loop in java?

0 Answers  


Categories