Method (computer programming): Difference between revisions

Content deleted Content added
Methods in C++: Nomenclature/tense/rewording. Replace "virtual method" by "virtual function". (I have never heard the term virtual method. It's certainly not used in the relevant texts.)
Line 125:
</syntaxhighlight>
 
==MethodsMember functions in C++==
Some procedural languages were extended with object-oriented capabilities to leverage the large skill sets and legacy code for those languages but still provide the benefits of object-oriented development. Perhaps the most well-known example wasis the[[C++]], an object-oriented extension of the [[C known as(programming language)|C++]] programming language. Due to the design requirements to add the object-oriented paradigm on to an existing procedural language, message passing in C++ hadhas some unique capabilities and terminologies. For example, in C++ a method was alsois known as a ''member function''. C++ also hadhas the concept of [[virtual methods:function]]s which are member functions that can be [[Method overriding|overridden]] in [[derived class]]es and allow for [[dynamic dispatch]].
 
===Virtual methodsfunctions===
''[[Virtual methodsfunction]]s'' are the means by which a C++ class can achieve polymorphic behavior. ''Non-virtual methodsmember functions'', or ''regular methods'', are those that do not participate in [[polymorphism (computer science)|polymorphism]].
 
C++ Example: