Encyclopedia > Override (object-oriented programming)

  Article Content

Method (computer science)

Redirected from Override (object-oriented programming)

A method is a special kind of subprogram belonging to a class.

An instance method is a method invoked with respect to an instance of a class. Instance methods are often used to examine or modify the state of a particular object. In Java and C++, constructors are instance methods which have the same name as their class. In typical implementations, instance methods take a hidden reference to the object they belong to.

In contrast to instance methods, a class method (a.k.a static method, shared method) can be invoked without reference to a particular object. These affect an entire class, not merely a particular instance of the class. A typical example of a class method would be one that keeps count of the number of created objects within a given class.

An abstract method is a method which has no implementation[?]. It is used to make a place-holder to be overriden later.

An accessor method is a kind of method that is usually small, simple and provides the way to bypass access control. Although it introduces new dependency, use of the methods are preferable because they provide a certain layer. An accessor method that changes the state of an object is sometimes especially called mutator or update method. Objects with that method is considered mutable object.

A method called initially in object creation is called constructor.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Holtsville, New York

... the town the population is spread out with 28.2% under the age of 18, 7.5% from 18 to 24, 33.5% from 25 to 44, 23.9% from 45 to 64, and 6.9% who are 65 years of age or ...

 
 
 
This page was created in 31 ms