Hi experts,
I have confusion about the point I read in my book:
I. In a source file you can define number of classes, but only one of them can be a public class. In this case, the name of source file must match the name of public class.
II. In a source file, you can define number of classes with default access specifier.
As I understand, one class must be public that is startup class and one or more class can be package(default).
Question
1. Suppose I have coded two classes in a source file, say in package X. And I want to use both of them in package Y. as far as I know, to use in outside package we have to put classes in access specifier public!
Should I have to put both the classes in different source file or what?
Thanks in advance for your cooperation all the way…
Jiten