Except for parentheses, most of them are not very useful, though. See also the type expression syntax rationale for other possible type constructors. Any class defined using the class declaration is also a type that denotes the set of all of its and its descendants' instances. These include the predefined classes, so Object , Date , etc. are all types. Meaning of Types Types are generally used to restrict the set of objects that can be held in a variable or passed as a function argument.
Type declarations use the Pascal-style colon syntax.
See the type declaration syntax rationale for an alternative. A type declaration does not affect the semantics of reading the variable or accessing one of its members. As a corollary, adding true type annotations does not change the meaning of a program. This operator has the same precedence as . and coerces its left operand to the right operand, which must be a type. If value is already a member of type , the type cast returns value unchanged.