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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sortedset in java?

1034


What do you understand by an io stream?

1052


What is the purpose of using the java bean?

1060


How do you convert an int to a string in java?

1141


How do you identify independent and dependent variables?

1011


What are the kinds of polymorphism?

1096


How do weakhashmap works?

1163


Is java still necessary?

1090


Explain the private protected method modifier?

993


what is use of functional interface in java 8?

1034


What are predicates in java 8?

1025


How finally used under exception handling?

952


How do you get length in java?

1038


What does g mean in regex?

996


what do you understand by the term string with respect to java?

1047