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

What is skeleton and stub?

0 Answers  


please send code example of inner classes?

2 Answers  


what is deadlock? : Java thread

0 Answers  


What are the types of methodology?

0 Answers  


Explain about member inner classes?

0 Answers  






how many access specifiers are available in java

11 Answers  


Why java doesn’t support multiple inheritances?

0 Answers  


How to extract HashMap values?

5 Answers   Marlabs,


Print Vertical traversal of a Binary Tree.

0 Answers   Amazon,


what is function overloading in java?

0 Answers   Tavant Technologies, TCS, Virtusa,


How TreeMap sorts the objects inside it?? suppose if have include one employee object and one car object. On what basis it will sort?

5 Answers  


What is a nonetype?

0 Answers  


Categories