Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Method overriding
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Language feature in object-oriented programming}} {{confuse|Function overloading}} [[File:Method overriding in subclass.svg|thumb|Illustration]] '''Method overriding''', in [[object-oriented programming]], is a language feature that allows a [[Subclass (computer science)|subclass]] or child class to provide a specific implementation of a [[Method (computer science)|method]] that is already provided by one of its [[superclass (computer science)|superclass]]es or parent classes. In addition to providing data-driven algorithm-determined parameters across virtual network interfaces,<ref>{{cite book |last1=Zhang |first1=Jie |title=2015 IEEE International Conference on Consumer Electronics - Taiwan |chapter=A novel P2P overridden API for open data communications in WWW |date=2015|pages=156β157 |doi=10.1109/ICCE-TW.2015.7216830 |isbn=978-1-4799-8745-0 |s2cid=23295793 }}</ref> it also allows for a specific type of [[Polymorphism_(computer_science)|polymorphism]] ([[subtyping]]). The implementation in the subclass overrides (replaces) the implementation in the superclass by providing a method that has same name, same [[Parameter (computer science)|parameters]] or signature, and same return type as the method in the parent class.<ref name="flanagan">Flanagan 2002, p. 107</ref> The version of a method that is executed will be determined by the [[Object (computer science)|object]] that is used to invoke it. If an object of a parent class is used to invoke the method, then the version in the parent class will be executed, but if an object of the subclass is used to invoke the method, then the version in the child class will be executed.<ref name="lewis-loftus">Lewis & Loftus 2006, p.454</ref> This helps in preventing problems associated with differential relay analytics which would otherwise rely on a framework in which method overriding might be obviated.<ref>{{cite book |last1=Overbey |first1=J |title=2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011) |chapter=Differential precondition checking: A lightweight, reusable analysis for refactoring tools |date=2011|pages=303β312 |doi=10.1109/ASE.2011.6100067 |isbn=978-1-4577-1639-3 |s2cid=5933208 }}</ref><ref>{{cite journal |last1=Li |first1=K |title=Residual investigation: Predictive and precise bug detection |journal=ACM Transactions on Software Engineering and Methodology |date=2014 |volume=24 |issue=2|doi=10.1145/2656201 |s2cid=47112802 }}</ref> Some languages allow a [[programmer]] to prevent a method from being overridden.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)