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

How do you create a sop?

0 Answers  


How many bytes is a string?

0 Answers  


What is compile time polymorphism?

20 Answers   CTS, Elementus Technologies, Oracle,


In what circumstances, compiler will supply a default constructor for a class?

4 Answers  


What is the list interface in java programming?

0 Answers  






Can we clone singleton object in java?

0 Answers  


Is string an object?

0 Answers  


What are the four versions of java?

0 Answers  


explain the concept of virtual method invocation in polymorphism in detail?

0 Answers   TCS,


What is the catch or declare rule for method declarations?

1 Answers  


What is anagram word?

0 Answers  


What do you understand by weak reference?

0 Answers  


Categories