can two class in a code be public??if yes then how??
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
What is method in java ?
What is this keyword in java?
Are floats faster than doubles?
Does java arraylist maintain insertion order?
why using interface interface ?
What are the advantages of compiled language?
What is unicode used for?
Difference between a Canvas and a Scroll Pane?.
This is my code i have a doubt class ab implements a,b { public void add() { System.out.println("Hi") } } interface a { public void add(); } interface b { public void add(); } in this code i have two interface implemented in the class has same method.just i want to know which method of interface implemented in the class. interface a or interface b? confused me .
what is diffrence between .NET and java?
What is update method and when it is called?
Which number is denoted by leading 0x or 0x in java?