Multiple choice technology programming languages

class Sub extends Super{ String name; Sub(String s) { super(s); name=s; } public static void main(String args[]){ Super sup = new Super("First"); Sub sub = new Sub("Second"); System.out.println(sub.name + " " + sup.name); } } class Super{ String name; Super(String s){ name =s ; } }

  1. Error: Super(java.lang.String) in Super cannot be applied to ()

  2. First Second

  3. Second First

  4. Runtime Exception

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The program compiles successfully because the superclass constructor Super(String s) is explicitly called. During execution, sub.name is "Second" and sup.name is "First", printing "Second First".