Multiple choice technology programming languages

Given: class Top { public Top(String s) { System.out.print("B"); } } public class Bottom2 extends Top { public Bottom2(String s) { System.out.print("D"); } public static void main(String [] args) { new Bottom2("C"); System.out.println(" "); } } What is the result?

  1. BD

  2. DB

  3. BDC

  4. DBC

  5. Compilation fails

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

Compilation fails because Bottom2's constructor implicitly calls the no-argument constructor of its superclass Top via super(). Since Top defines a parameterized constructor, the compiler does not generate a default no-argument constructor, leading to a compilation error.