Your problem is thinking "The main method and Class3 are both inside Class1 so how come the main method cannot see it?"

consider the following:

class Foo {
public static void main(String[]...