Menu
Question Index
...

Given the classes M, N and O, which of the classes U, W, X, Y and Z fail to compile.

class M { public void m1(int i) { } }

class N { private void m1(int i, int j) { } }

class O { protected void m1(int i) { } }

//--------------

class U extends O { private void m1(int i, int j) { } }

class W extends M { protected void m1(int i, int j) { } }

class X extends M { private void m1(int i) { } }

class Y extends N { private void m1(int i) { } }

class Z extends O { void m1(int k) { } }


M, X, Y
U, X, Y, Z
X, Z
U, W, X
All of them compile

Doubts

Problems

Topic: Access Modifiers In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App