What is the result?

Given:

What is the result?

Given:

What is the result?

A.
woof arf

B.
woof woof

C.
arf arf

D.
A RuntimeException is generated

E.
The code fails to compile

Explanation:

class Dog {
protected String bark()
public class Beagle extends Dog {
private String bark()
Cannot reduce the visibility of the inherited method from Dog



Leave a Reply 1

Your email address will not be published. Required fields are marked *