Multiple choice technology web technology

interface I{ void f1(); // 1 public void f2(); // 2 protected void f3(); // 3 private void f4(); // 4 abstract void f5(); // 5 }

  1. line 1,2,3,4

  2. line 3,4

  3. line 3

  4. line 2,3,4

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

In Java interfaces, all methods are implicitly public and abstract. Explicitly adding modifiers like public (line 2), protected (line 3), or private (line 4) is not allowed. Lines 3 and 4 with protected and private modifiers are invalid. Option B correctly identifies lines 3 and 4 as erroneous.