What will happen after the following code is compiled and executed?

abstract public class Parent {
    String s = "hello!";
    public void test() {

class P {
    public static void main(String[] args) {
        Parent p = new Parent();

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

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes