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

In the below example, how many string objects are created?

1047


Can we have static methods in an interface?

1057


What all methods are used to prevent thread execution ?

1033


How many types of memory areas are allocated by jvm?

1045


What is compareto?

1040


Can we override constructors?

1003


State one difference between a template class and class template.

1068


How do you reverse sort a list in java?

937


What is nested interface?

1010


What does java ide mean?

1139


What is the difference between preemptive scheduling and time slicing in java programming?

1015


Explain about the security aspect of java?

967


Write a java program to count the number of words present in a string?

982


What is the difference between the prefix and postfix forms of the ++ operator?

1021


Does java allow default arguments?

996