I read that Java Source Fiel can have any number of classes and the Surce File name shoul be having a match to at least one Publci Class in the Source.
For Eg:
my Java Source file name is Example.java.
here is the source
class Example{}
class SomeotherClass{}
When I compile this it is not giving me Compilation error. I am expecting Compilation error becasue Example should be Public. ANd one more question is the order make sence to the compier ?
Thanks for solution
For Eg:
my Java Source file name is Example.java.
here is the source
class Example{}
class SomeotherClass{}
When I compile this it is not giving me Compilation error. I am expecting Compilation error becasue Example should be Public. ANd one more question is the order make sence to the compier ?
Thanks for solution