Why only one Class is public in one file? Explain in
details. Thanks in Advance.
Answer Posted / gopi
The class main method is start with public . This is
starting of the program, compiler have to know where to
start the program to compile. so only one public is there to
avoid confusion. We also use the public method to interact
with the out side of the programs. Without using of the
public class it can't possible to interact.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the default value of an object reference declared as an instance variable?
what is thread? : Java thread
What is the purpose of return statement?
What is called module?
Which number is denoted by leading zero in java?
Explain about narrowing conversion in java?
Can interface be private in java?
What is a numeric format?
What is a superclass?
What is the difference between instanceof and isinstance?
What is float in java?
How many types of parsers are there?
Explain the difference between abstraction and encapsulation.
Name few "optional" classes introduced with java 8 ?
What are keywords in programming?