Unexpected runtime error: Could not load main Class
<p>I was trying on some code to better understand the access modifiers. Everything was running great after I added jus one line of code</p>

<pre><code>class SomeClass2 {

  protected static void method4() { }
  protected static int x=0;
}
class SomeClass3 extends SomeClass2{

    int c=SomeClass2.x;
    public void somemethod() //Everything was compiling fine until
    {                        //Until I added this method
    SomeClass2.method4();
    }
}
class DemoClass1{
      public static void main(String[] parameters) {
    SomeClass2 sc = new SomeClass2();
    SomeClass3 sc1 = new SomeClass3();

    sc.method4();
    System.out.println(sc1.c);
sc1.somemethod();

  }
}
</code></pre>

<p>I am getting an error: <code>Could not find or load main class DemoClass1</code>
All the classes belong to same directories and same package. And environmental variables are all set too. It was compiling and running fine until I added <code>somemethod()</code>. It compiles fine but does not run.</p>
