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

Differences between traditional programming language and object oriented programming language?

0 Answers  


How can we run a java program without making any object?

0 Answers  


Write code to implement bubble sort in java?

0 Answers  


What is the output of the below java program?

0 Answers  


whst is encapsulation?when u encpsulate actually while devoloping code?

7 Answers   Amdocs, MGL,


What are library required to connect to excel sheet.

2 Answers   Cap Gemini,


I don’t want my class to be inherited by any other class. What should I do?

0 Answers  


Why do you canvas?

0 Answers  


Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this

1 Answers  


What is an iterator java?

0 Answers  


Is null a string?

0 Answers  


How is tree Mirroring implemented?

0 Answers   Fidelity,


Categories