class Base
{
void method()
{
System.out.println("Base method");
}

}
class Sub extends Base
{
void subMethod()
{
System.out.println("sub subMethod");
}
public static void main(String[] args) 
{
//System.out.println("Hello World!");
Base b= new Base();
//((Sub)b).subMethod();
Sub s= new Sub();
s.subMethod();
}
}--------------------------
编译可以通过,运行时提示Exception in thread "main" java.lang.NoSuchMethodError: main 
我把main方法放在Base类里面就可以成功运行,不知道哪里错了。