My Hindi Forum

Go Back   My Hindi Forum > Miscellaneous > Tech Talks
Home Rules Facebook Register FAQ Community

Reply
 
Thread Tools Display Modes
Old 30-12-2009, 10:16 PM   #1
rajesh
Member
 
rajesh's Avatar
 
Join Date: Dec 2009
Posts: 76
Rep Power: 15
rajesh is on a distinguished road
Post What is Method Overriding?

When a class defines a method using the same name, return type, and argument list as that of a method in its superclass, the method in the subclass is said to override the method present in the Superclass. When the method is invoked for an object of the class, it is the new definition of the method that is called, and not the method definition from superclass.

Restrictions placed on method overriding

Overridden methods must have the same name, argument list, and return type.
The overriding method may not limit the access of the method it overrides. Methods may be overridden to be more public, not more private.
The overriding method may not throw any exceptions that may not be thrown by the overridden method.
rajesh is offline   Reply With Quote
Reply

Bookmarks

Tags
method overriding


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT +5. The time now is 05:05 PM.


Powered by: vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
MyHindiForum.com is not responsible for the views and opinion of the posters. The posters and only posters shall be liable for any copyright infringement.