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

What are daemon Threads in java?

1205


What is difference between path and classpath variables?

1094


What does sizeof return?

994


What is the difference between menuitem and checkboxmenu item?

1340


Does google use java?

966


Explain java coding standards for interfaces?

1113


Differentiate between the constructors and methods in java?

948


What is append function?

1003


How do you differentiate abstract class from interface?

961


Can we have multiple public classes in a java source file?

1193


How does queue work in java?

987


Why arraylist is used in java?

1075


why using interface interface ?

2047


How many bytes is double?

973


What is string length in java?

951