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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
The compile-time type (or static type) of the
objvariable isjava.lang.Object. At execution time, however, the value ofobjis a reference to an object of typejava.lang.String.