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
Tell me how many ways are there to initialise an integer with a constant.
Why java is not 100% object-oriented?
Can constructor be protected in java?
What do you mean by checked exceptions?
Can abstract class have private constructor?
Why java is made?
What is the purpose of skeleton and stub?
Can we create an object of static class in java?
Where is the find and replace?
What is compiler and what its output.
What is meant by object oriented programming – oop?
Can static methods be inherited?
How does arrays sort work in java?
What is try-with-resources in java?
Which is the best approach for creating thread ?