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
If a method is declared as protected, where may the method be accessed in java programming?
What is immutable state?
What does java edition mean?
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
How can an exception be thrown manually by a programmer?
What do you mean by hashing?
What is multithreading and its advantages?
Explain, java is compatible with all servers but not all browsers?
String class is defined under which package in java?
What is Session reduplication and how its done?
What is methods in java?
What do you mean by data type?
What is difference between hashset and hashmap in java?
What is a line break?
Is array synchronized in java?