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

Define an applet in java?

1136


Can you achieve runtime polymorphism by data members?

1131


What is exception propagation?

1119


Why is stringbuffer faster than string?

900


What is another word for methodology?

1002


What is java and their uses?

1017


How many bytes is a url?

971


How do you compare values in java?

1014


Explain differences between checked and unchecked exceptions in java?

1050


What is use of set in java?

977


Can a function return a function?

1019


What is the purpose of the enableevents() method?

1029


What is the integer of 16?

951


What is difference between public static and void?

988


What is finalize() function in java?

998