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 are locale settings?

552


What is procedure overloading?

1802


What do you mean by singleton class in java?

517


What are static initalizers in java ?

583


Which is the best sorting technique in java?

527






In java, what is the difference between method overloading and method overriding?

583


What is a ternary operator in java? What is an interface?

553


Define jre i.e. Java runtime environment?

576


How do constructors use this() and super()?

549


How will you add panel to a frame?

649


Can substring create new object?

560


Can the garbage collection be forced by any means?

534


What are packages in java?

566


How do you check if two strings are equal in java?

587


Why stringbuilder is not thread safe in java?

574