Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java "fresh type variable"

Tags:

java

jls

What does "fresh type variable" mean in the JLS Conversions and Promotions chapter?

like image 855
Ilya Lakhin Avatar asked Sep 17 '10 08:09

Ilya Lakhin


People also ask

What is wildcard capture in Java?

In some cases, the compiler infers the type of a wildcard. For example, a list may be defined as List<?> but, when evaluating an expression, the compiler infers a particular type from the code. This scenario is known as wildcard capture.

What is capture of in Java?

The Java compiler internally represents the value of a wildcard by capturing it in an anonymous type variable, which it calls "capture of ?" (actually, javac calls them "capture #1 of ?" because different uses of ? may refer to different types, and therefore have different captures).


1 Answers

Fresh is the common designation for a variable that must not have been used before.

like image 85
Volker Stolz Avatar answered Nov 15 '22 17:11

Volker Stolz