Type
A type is a set of values supporting a certain set of operations.
Closest Wikipedia entry: Type system — In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type (for example, integer, floating point, string) to every term (a word, phrase, or other set of symbols). Usually the terms are various language constructs of a computer program, such as variables, expressions, functions, or modules. A type system dictates the operations that can be performed on a term.
Misconceptions about Type38 documented Misconceptions
Check YourselfArrayElementTypeRepeats
The type of a multi-dimensional array is written as T[] T[] T[]ArrayElementsUntyped
Elements of arrays are untypedArrayLengthPartOfType
The length of an array is part of its typeArrayRankNotPartOfType
The rank of an array is not part of its typeCharNotNumeric
Char is not a numeric typeCompositeExpressionsUntyped
Expressions that consist of multiple parts have no typeExpressionsDynamicallyTyped
One has to evaluate an expression to determine its typeIntegerDivisionToRational
Dividing two integers can produce a rational numberLargeIntegerLong
Large integer numbers have type longMethodWithoutReturnType
A method declaration does not need to include a return typeNamedTypeParameter
To instantiate a generic type, one needs to specify type parameter names as well as types NoCastIfSameSize
If a variable is at least as big (bit-width) as a value, then no cast is needed to a assign the value to the variableNoFloatLiterals
There are no float literalsNoImplicitWidening
Smaller types are never automatically converted into bigger ones without an explicit castNoLongLiterals
There are no long literalsNumericToBooleanCoercion
Numeric types can be coerced to booleanPrimitiveTypeParameter
Type parameters of generic types can be assigned primitive typesPrimitiveVariablesDynamicallyTyped
The type of a primitive variable depends on its valueRecursiveMethodImpliesRecursiveType
A class with a recursive method represents part of a recursive data structureReferenceLabeledWithDynamicType
In stack and heap diagrams, reference variables are labeled with the types of the objects they refer toReferenceToBooleanCoercion
Every reference type can be coerced to booleanReferenceToIntegerConversion
One can cast between references and intsStaticCallPolymorphic
A static method call is dispatched polymorphically at runtime based on the argument typesSubtypeCompatibleWithSupertype
A variable of a subtype can reference an object of a supertypeSupertypeIncompatibleWithSubtype
A variable of a supertype cannot reference an object of a subtypeTargetTyping
The type of a numerical expression depends on the type expected by the surrounding contextUntypedVariables
Variable declarations don't need a typeUseOfSelfTypeImpliesRecursiveType
If a class has a method that has a local variable, parameter, or return value with the class as its type, the class is a recursive typeVoidMethodNotRecursive
A method with void return type can't be recursiveVoidMethodReturnsValue
A method with void return type can return a value