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 the benefit of abstract class?

517


What is the purpose of encapsulation?

545


What about interthread communication and how it takes place in java?

553


What is integers and example?

498


When should the method invokelater() be used?

587






Do you know how to reverse string in java?

588


What is use of map in java?

519


Can you achieve runtime polymorphism by data members?

593


What is the major advantage of external iteration over internal iteration?

617


What is a “stateless” protocol ?

563


How do you start a thread?

556


How can you handle java exceptions?

533


What is abstract class? Explain

599


Which is better 64 bit or 32 bit?

514


What does three dots mean in java?

659