List l = new ArrayList<Number>();
The static type of l is List? What does "static type" here mean? I read it in sun's java tutorials
The "static type" of an expression is the type as the compiler thinks of it - the compile-time type. This may be different from the execution-time type of the value of the variable.
For example, consider this:
Object obj = "hello";
The compile-time type (or static type) of the obj
variable is java.lang.Object
. At execution time, however, the value of obj
is a reference to an object of type java.lang.String
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With