when asub class inherits a super class and overrides a
public method of super class in sub class(public method in
super class).
why these methods needs to be public in sub class.
(otherwise compile time error).

Answer Posted / ravikiran

the access specifies sould not me more restrictive in a
subclass.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the epoch date?

564


Can we assign null to double in java?

542


What is lambda programming?

490


What is indexof in java?

508


What are the four pillars of java?

604






What is stream api in java8?

533


How can you generate random numbers in java?

577


What is entry in java?

525


What do you understand by the term polymorphism?

623


Is finalize() similar to a destructor?

546


What is difference overloading and overriding?

577


What is the requirement of thread in java?

610


What is the difference between hashmap and hashtable in java?

550


What are the topics in core java?

527


What is difference between throw and throws ?

592