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

Is string an object?

870


What java is used for?

832


What is JDBC Driver interface?How can you retrieve data from the ResultSet

1776


How to sort elements in a parallel array in java?

685


How to instantiate static nested classes in java?

783


Differentiate between run time error and syntax error.

819


How is java hashmap implemented?

775


How do you get length in java?

783


Are strings immutable in java?

733


What a static class can contains?

920


How to retrieve data from database in java using arraylist?

749


What is object-oriented paradigm?

827


What is variable explain?

728


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

744


What are the loops in java?

746