can two class in a code be public??if yes then how??
Answer Posted / siva
NO only one class should be public if we write multiple
classes in a same file.we can write multiple class files in
a single file.if main() is there in one of the classes then
it should be declare as public.
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is the Scope of Static Variable?
What are the legal parameters?
What is the list interface in java programming?
When should I use stringbuffer?
Define a package.
Explain illegalmonitorstateexception and when it will be thrown?
What are runtime exceptions?
Can a class have multiple subclasses?
What is a method header?
what is method reference in java 8?
What is the full name of java?
Can you access non static variable in static context?
What are inbuilt functions in java?
How do you convert an int to a double in java?
Explain the difference between abstraction and encapsulation.