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 is mena by object block any what is the use of that

2262


Explain differences between checked and unchecked exceptions in java?

1114


Why can't we use static class instead of singleton?

994


What is a lock or purpose of locks in java?

1087


what is the constructor and how many types of constructors are used in java?

1036


Is java code slower than native code?

1120


What happens when a thread cannot acquire a lock on an object in java programming?

1072


Define array. Tell me about 2-D array.

1104


What are the features of junit?

1089


What’s the difference between constructors and other methods?

1049


What is meant by the value of a variable?

983


What is classpath?

1064


Is array a class in java?

1034


What is a parameter in matrices?

1107


What are strings in physics?

1071