Selection statements
A java Program can contain any no. Of classes but at most one class can be declared as public. "If there is a public class the name of the Program and name of the public class must be matched otherwise we will get compile time error".
If there is no public class then any name we gives for java source file.
Case 1:
- If there is no public class then we can use any name for java source file there are no restrictions.
Example:
A.java
B.java
C.java
Ashok.java