Field
A field is a variable that is a member of a class and may be part of an object.
Related concepts: VariableMemberClassObject
Closest Wikipedia entry: Field (computer science) — In data hierarchy, a field (data field) is a variable in a record. A record, also known as a data structure, allows logically related data to be identified by a single name. Identifying related data as a single group is central to the construction of understandable computer programs.
Misconceptions about Field21 documented Misconceptions
Check YourselfAddMemberAtRuntime
Set of class members can change at runtimeArrayHasLengthMethod
To get the length of an array, one needs to call its length methodCannotChainMemberAccesses
Member accesses cannot be chained togetherCannotChainMemberToConstructor
Method calls or field accesses cannot be chained to a constructor invocationConstructorParameterIsField
Formal constructor parameters are equivalent to instance variablesMethodAsField
Each object contains its own special fields for all of its methodsMustInitializeFieldInConstructor
Constructors must assign values to all fieldsNoFieldInheritance
An object contains only the fields declared in its classNoFieldlessObjects
Objects without instance variables can't existNoMethodInheritance
Subclasses inherit fields but not methodsPrivateAccessibleInSubclass
Private members of a superclass are accessible from a subclassPrivateFieldsImplyImmutability
A class where all fields are private is immutablePrivateMeansFinal
A private field cannot be changedRightToLeftChaining
Chained accesses are invoked from right to leftStringLengthField
One can know the length of a String object by accessing its length fieldThisAsField
this is a special field in the object