abstract public class Parent {
String s = "hello!";
public void test() {
System.out.println(s);
}
}
class P {
public static void main(String[] args) {
Parent p = new Parent();
p.test();
}
}
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Parent is abstract; cannot be instantiated at P.main
2016 Mar 19, 7:15:06 PM
Login in to like
Login in to comment