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
Is list ordered in java?
Why deletion in linkedlist is fast than arraylist?
Explain serialization and deserialization in java?
What is java util list?
What are the types of inner classes (non-static nested class) used in java?
Explain the init method?
What is fail first in java?
What is a local block?
What is internal variable?
Is java a pure object oriented language?
What is the final keyword denotes?
Is string pool garbage collected?
What is return type in java?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
What is the difference between static and non-static variables in java programming?