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. The data is in the form of fields (often known as attributes or properties), and the code is in the form of procedures (often known as methods). A common feature of objects is that procedures (or methods) are attached to them and can access and modify the object's data fields.
Misconceptions about Object34 documented Misconceptions
Check YourselfAssignmentCopiesObject
Assignment copies the objectBoxedNull
Passing null to a wrapper class constructor creates an object representing the absence of a valueChainedMethodsNotCalledFromOutside
Chained methods are all called on the object at the beginning of the chainEqualityOperatorComparesObjectsValues
o==p compares the objects referred to by variables o and pEqualsComparesReferences
o.equals(p) compares the references stored in the variables o and pFrameIsClassInstance
A stack frame is the same as an instance of a classMethodAsField
Each object contains its own special fields for all of its methodsMultiReferenceVariable
A reference variable can point to multiple objectsNestedObjectsImplyNestedClasses
If objects are part of a containment hierarchy, their classes are nested, tooNoFieldInheritance
An object contains only the fields declared in its classNoFieldlessObjects
Objects without instance variables can't existNoInsideMethodCallInConstructor
It is foirbidden to call other methods on the same object while inside its constructorNullIsObject
null is an objectObjectLabeledWithConstructorSignature
In stack and heap diagrams, an object on the heap is labeled like a stack frame of a constructor callObjectLabeledWithVariableName
In stack and heap diagrams, an object on the heap is labeled with the name of the variable that refers to itPrimitiveIsObject
Primitive values are heap objectsReferenceLabeledWithDynamicType
In stack and heap diagrams, reference variables are labeled with the types of the objects they refer toSuperclassObjectAllocated
When instantiating an object of a subclass, an object of a superclass is also allocatedThisAsField
this is a special field in the objectThisAssignable
One can assign to thisThisExistsInStaticMethod
this is a local variable, also in static methodsVariablesHoldObjects
A variable of a reference type contains a whole object