MethodAsField
DRAFT

Misconception:

An object contains a bunch of properties: some of them are instance variables (they represent state), others are instance methods (they represent behavior). Thus, one can say that for each method there is a special field (or property) in the object.

Incorrect

Each object contains its own special fields for all of its methods

Correct

Each object contains a special field referring to its class, and the class knows about its methods

Correction
Here is what's right.

Objects contain fields (instance variables) that hold the state of the object. The methods are not stored in fields. The methods are not stored in the objects.

However, an object knows its class (e.g., through a special field in the object’s header), and the class knows about all the instance methods available to any of its instances.

Language

Java

Concepts

Expressible In

Related Misconceptions

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.