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

What restrictions are placed on method overloading and
method overriding?

Answer Posted / aks

The rules for overriding a method are as follows:
¡ The argument list must exactly match that of the
overridden method.
¡ The return type must exactly match that of the
overridden method.
¡ The access level must not be more restrictive than that
of the overridden method.
¡ The access level can be less restrictive than that of
the overridden method.
¡ The overriding method must not throw new or broader
checked exceptions

The rules for overloading a method are as follows:
¡ Overloaded methods must change the argument list.
¡ Overloaded methods can change the return type.
¡ Overloaded methods can change the access modifier.
¡ Overloaded methods can declare new or broader checked
exceptions.
¡ A method can be overloaded in the same class or in a
subclass.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many digits is int32?

949


How many bytes is a string java?

978


What is the difference between length and length () in java?

902


Should a main method be compulsorily declared in all java classes?

1015


How do you start a thread?

995


What is difference between this and super keyword?

949


Which sorting algorithm is best in java?

950


Can the garbage collection be forced by any means?

947


Is simpledateformat safe to use in the multithreaded program?

962


How many static init can you have?

1163


What is difference between call by value and call by reference?

957


Why string is a class?

907


What is a numeric string?

978


How do you add an element to an arraylist in java?

902


What is the range of the short type?

959