Q. What is the output of the above program?
class Num {
Num(double x ){
System.out.println( x ) ;
}
}
public class Test extends Num {
public static void main(String[] args){
Num num = new Num( 2 ) ;
}
}
β
Correct Answer: (C)
Compile time error
Explanation: The given program creates a class Num that has a constructor with a double parameter.