Object

An object is an instance of a class stored in a set of memory locations.

Related concepts:  ClassTypeValue

Closest Wikipedia entry:  Object-oriented programming — Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code: data in the form of fields (often known as attributes or properties), and code in the form of procedures (often known as methods). A common feature of objects is that methods are attached to them and can access and modify the object's data fields. In this brand of OOP, there is usually a special name such as this or self used to refer to the current object.

Authoritative Definition

Wikipedia does not necessarily offer the best fitting definition of a concept. The exact meaning we attribute to the concept of Object is based on principled authoritative sources such as:

Misconceptions about Object
35 documented Misconceptions

Check Yourself
Misconception
AssignmentCopiesObject
Assignment copies the object
Misconception
BoxedNull
Passing null to a wrapper class constructor creates an object representing the absence of a value
Misconception
ChainedMethodsNotCalledFromOutside
Chained methods are all called on the object at the beginning of the chain
Misconception
EqualityOperatorComparesObjectsValues
o==p compares the objects referred to by variables o and p
Misconception
EqualsComparesReferences
o.equals(p) compares the references stored in the variables o and p
Misconception
FrameIsClassInstance
A stack frame is the same as an instance of a class
Misconception
MethodAsField
Each object contains its own special fields for all of its methods
Misconception
MultiReferenceVariable
A reference variable can point to multiple objects
Misconception
NestedObjectsImplyNestedClasses
If objects are part of a containment hierarchy, their classes are nested, too
Misconception
NoFieldInheritance
An object contains only the fields declared in its class
Misconception
NoFieldlessObjects
Objects without instance variables can't exist
Misconception
NoInsideMethodCallInConstructor
It is foirbidden to call other methods on the same object while inside its constructor
Misconception
NullIsObject
null is an object
Misconception
ObjectLabeledWithConstructorSignature
In stack and heap diagrams, an object on the heap is labeled like a stack frame of a constructor call
Misconception
ObjectLabeledWithVariableName
In stack and heap diagrams, an object on the heap is labeled with the name of the variable that refers to it
Misconception
PrimitiveIsObject
Primitive values are heap objects
Misconception
ReferenceLabeledWithDynamicType
In stack and heap diagrams, reference variables are labeled with the types of the objects they refer to
Misconception
SuperclassObjectAllocated
When instantiating an object of a subclass, an object of a superclass is also allocated
Misconception
ThisAsField
this is a special field in the object
Misconception
ThisAssignable
One can assign to this
Misconception
ThisExistsInStaticMethod
this is a local variable, also in static methods
Misconception
VariablesHoldObjects
A variable of a reference type contains a whole object

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.