Multiple choice technology programming languages

package overriding; class Super4 { final void testSuper() { System.out.println("I am Super"); } } public class TestOverrideSub4 extends Super4{ void testSuper() { System.out.println("I am Sub"); } public static void main(String[] args) { Super4 s4 = new TestOverrideSub4(); s4.testSuper(); } }

  1. Compiler Error

  2. I am Sub

  3. I am Super

  4. Exception

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

A method marked final cannot be overridden. The superclass declares testSuper() as final, but the subclass attempts to override it. This is a compiler error.