The following is from MARCUS tutorial
*********************************************
A file can only contain one outer public class. If you attempt to create a file with more than one public class the compiler will complain with a specific error. A file can contain multiple non public classes, but bear in mind that this will produce separate .class output files for each class
**********************************************
It's fine that a file should have only one "outer public" class.
What will happen if we have many "inner public" classes will they be considered as simply a class and compiled as a separate .class file.
For example
public class A
{
public static void main(
String nat[])
{
System.out.println("hi XXXXX");
}
public class B
{
System.out.println("hi YYYY");//works fine without this statement
//but generates error when this statement is included.
}
}
Can any of you please explain what's the problem when we include the statement ?
Thanks