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 unicode used for?
What do you mean by global variable?
What is string literal in java?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
What are the important methods of java exception class?
What is methods in java?
Explain treeset?
Can two objects have same hashcode?
write a program that list all permutations of ABCDEF in which A appears before B?
Are arrays primitive data types?
Explain reverse a linked list recursive java solution?
How to instantiate member inner class?
What is meant by design patterns?
What are abstract methods in java?
Is alive method in java?