can two class in a code be public??if yes then how??
Answer Posted / sreejesh1987
One java source file must have only one top-level(top level means not an inner class) public class with the same name as the name of the source file .
You can have inner classes to a class which are public. Hence in this way it is possible to have more than one public class in a single file.
| Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
Give an example of use of pointers in java class.
How is hashcode calculated in java?
What is arrays aslist in java?
Explain the key functions of data binding?
Why java does not support pointers?
What are implicit objects in java?
What is difference between string and stringbuffer?
What is double checked locking in singleton?
How do you insert a line break?
Do you need to import math in java?
What is user defined exception in Java?
What is stringbuffer in java?
What is a concrete classes? Is Java object class is concrete class?
Can a boolean be null java?
What's the base class in java from which all classes are derived?