Content deleted Content added
m removing title bolding |
Revert to revision 911104023 dated 2019-08-16 14:48:52 by 2620:149:E0:6001:0:0:0:E0 using popups |
||
Line 7:
Methods also provide the interface that other classes use to access and modify the data [[Property (programming)|properties]] of an object. This is known as encapsulation. Encapsulation and overriding are the two primary distinguishing features between methods and procedure calls.<ref>{{cite web|title=What is an Object?|url=http://docs.oracle.com/javase/tutorial/java/concepts/object.html|work=oracle.com|publisher=Oracle Corporation|accessdate=13 December 2013}}</ref>
==Overriding and
[[Method overriding]] and
| accessdate = 2011-08-12
| author = John Suzuki
Line 39:
</syntaxhighlight>
==Accessor,
Accessor methods are used to read data values of an object. Mutator methods are used to modify the data of an object. Manager methods are used to initialize and destroy objects of a class, e.g. constructors and destructors.
Line 62:
A ''[[Destructor (computer science)|destructor]]'' is a method that is called automatically at the end of an object's lifetime, a process called [[object lifetime|destruction]]. Destruction in most languages does not allow destructor method arguments nor return values. Destruction can be implemented so as to perform cleanup chores and other tasks at object destruction.
====
In [[Garbage collection (computer science)|garbage-collected]] languages, such as [[Java (programming language)|Java]], [[C Sharp (programming language)|C#]], and [[Python (programming language)|Python]], destructors are known as ''[[finalizer]]s''. They have a similar purpose and function to destructors, but because of the differences between languages that utilize garbage-collection and languages with manual memory management, the sequence in which they are called is different.
==Abstract methods==
An ''abstract method'' is one with only a [[method signature|signature]] and no [[method body|implementation body]]. It is often used to specify that a subclass must provide an implementation of the method. Abstract methods are used to specify [[Interface (computing)|interfaces]] in some computer languages.<ref>{{cite web|title=Abstract Methods and Classes|url=http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html|website=oracle.com|publisher=Oracle Java Documentation|accessdate=11 December 2014}}</ref>
|