Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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).

Answers were Sorted based on User's Feedback



when asub class inherits a super class and overrides a public method of super class in sub class(pu..

Answer / imtiyaz

The access specifier for the overriding method can allow
more but not less access than the overridden method.
For example, a protected method in the superclass can be
made public but not private

private, protected and public is Ascending order of access
modifiers depending upon the strength

Is This Answer Correct ?    1 Yes 0 No

when asub class inherits a super class and overrides a public method of super class in sub class(pu..

Answer / ravikiran

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

Is This Answer Correct ?    1 Yes 0 No

when asub class inherits a super class and overrides a public method of super class in sub class(pu..

Answer / sushila

if super class method is public, then override method should
be public.

override method will take same access specifier or expanded one.

the order of access specifier is
private > default > protected > public

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why is a string immutable?

0 Answers  


What is token in java?

0 Answers  


What is the best way to findout the time/memory consuming process?

0 Answers  


define System.out.println(); what is the meaning!

19 Answers   Accenture,


Why java uses the concept of the string literal?

0 Answers  


Is alive and join method in java?

0 Answers  


Can a private method be declared as static?

0 Answers   Global Logic,


GoldMansachs Interview process....

1 Answers   Goldman Sachs,


What is casting?

3 Answers  


What are bind parameters?

0 Answers  


Can a constructor have different name than a class name in java?

0 Answers  


What is math exp in java?

0 Answers  


Categories