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

How to compare strings in java?

586


How does multithreading take place on a computer with a single cpu?

652


What is the right data type to represent a price in java?

646


Explain about the interpreter in java?

733


Does java support multiple inheritances?

674






What all methods are used to prevent thread execution ?

642


How static variable work in java?

684


Is object a data type?

650


How do I write a self declaration?

640


Can we able to pass objects as an arguments in java?

625


What is a war file?

641


what is the constructor and how many types of constructors are used in java?

618


What is a method in coding?

666


What is a conditional statement explain with example?

630


Explain the use of sublass in a java program?

668