Need to use public,static keywords in main function?

Answer Posted / aravinda reddy

1) Public access modifier specifies class declared can be
accesses from anywhere

2) where as static refers with out creating instance of the
class JVM should access the main class while executing.

3) void specified main function should not return any value

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an interface in java? Explain

797


What is variable declaration and definition?

733


Is singleton a bad practice?

796


What is independent and dependent variables in research?

642


Explain notify() method of object class ?

841


What is use of a abstract variable?

732


What are meta-annotations?

724


Where is core java used?

763


What if constructor is protected in java?

752


Explain the meaning of java applet.

821


What is difference between next () and nextline () in java?

741


What is double in java?

722


What are multiple inheritances?

812


What is singleton class in ruby?

778


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

819