I really don't understand why the getMyClass2 method below cannot be static, why isn't it valid Java code?
public class MyClass
{
private class MyClass2
{
public String s1 = "";
public String s2 = "";
}
private MyClass2 myClass2;
private static MyClass2 getMyClass2()
{
MyClass2 myClass2 = new MyClass2();
return myClass2;
}
public MyClass()
{
myClass2 = getMyClass2();
}
}