Menu
Topics Index
...
`

Access Specifiers Inheritance


If you need explanation Read this topic

If you need Answer Take test on this topic

Access Specifiers Inheritance
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) { } }

A. M, X, Y
B. U, X, Y, Z
C. X, Z
D. U, W, X
E. All of them compile
Topic: Access Modifiers In Java

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

c

Posted by Shubham Bansal    2014-12-24 15:49:11


This dose is now closed and the winners are Sai Ram,  for 'First Correct Comment', Sai Ram,  for 'Best Comment' and Sai Ram for the 'Popular Comment'. The 'lucky liker' is Uday Kumar. Please login into Merit Campus using facebook, to claim your recharge. Go to http://java.meritcampus.com/earnings to raise the recharge.

Posted by Merit Campus    2014-12-25 05:36:28


© meritcampus 2019

All Rights Reserved.

Open In App