Can we create two public class in the same Solution.java file.!!!
Can we create two public class in the same Solution.java file.!!!
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
RKVengatesh Enterprise Java Developer at Fragma Data Systems
14 September 2018, 11:17
Yes, it can. However, there can only be one public class per .java file, as public classes must have the same name as the source file.
One Java file can consist of multiple classes with the restriction that only one of them can be public.
0
Artem Divertitto Senior Android Developer at United Tech
13 September 2018, 07:36
Yes, u can. But not recommended
0
amaral
12 September 2018, 12:43
i thik no.
0