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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you clear an arraylist in java?

937


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

1073


How do you define a singleton class?

1011


How list contains works in java?

928


What all methods are used to prevent thread execution ?

965


What Is Query Throttling in java?

961


What are memory tables?

1055


What is the purpose of the system class in java programming?

1007


How do you sort a set in java?

859


What is the memory leak in java?

968


What does sprintf return?

1011


String class is defined under which package in java?

1021


What is boolean false?

930


What is meant by vector class, dictionary class, hash table class, and property class?

1085


Convert a BST into a DLL and DLL to BST in place.

1071