Explain Public static void main?

Answers were Sorted based on User's Feedback



Explain Public static void main?..

Answer / ranganathkini

public static void main( String[] args )

1. public - declares that the main method is publicly
accessible to other classes

2. static - declares that the main method can be invoked
without creating an instance of the class

3. void - declares that the main method does not return any
value.

4. main - defines the name of the method

5. String[] args - defines a parameter to the main method
which will contain any command line options passed by the
user when invoking the progam.

These command line options will be passed to the program as
an array of string objects.

Is This Answer Correct ?    182 Yes 6 No

Explain Public static void main?..

Answer / ravikiran(aptech mumbai)

public-this method is accessible in all the classes
static-this method is called before creation of any instance
void-this method doesn't return any thing
main-Is the name of the method

Is This Answer Correct ?    58 Yes 19 No

Post New Answer

More Core Java Interview Questions

explain the difference between jdk and jvm?

0 Answers  


Why is stringbuffer thread safe?

0 Answers  


What is singleton class in ruby?

0 Answers  


How to read and write image from a file ?

0 Answers  


what is use of session tracking ?with example?

1 Answers   Photon,






What class allows you to read objects directly from a stream?

0 Answers  


what is difference betwwen hashmap and hashtable ?

7 Answers   Fidelity,


How to make class immutable

6 Answers  


Name the runtime exceptions that occurs frequently?

4 Answers  


What are dot operator queries?

0 Answers   Atos Origin,


What is function and method in java?

0 Answers  


Explain what access modifiers can be used for variables?

0 Answers  


Categories