Java type system

https://www.oreilly.com/library/view/java-in-a/9781449371296/ch04.html

Java static type system

A statically typed language is one in which variables have definite types, and where it is a compile-time error to assign a value of an incompatible type to a variable. Java is an example of a statically typed language. Languages that only check type compatibility at runtime are called dynamically typed—JavaScript is an example of a dynamically typed language.

references types

classes
arrays
interfaces
generics

compile-time types and runtime types

special classes and interfaces

enums
annotations

nested types

你可能感兴趣的:(Java type system)