Skip to content
Advertisement

Tag: var

Why java allows “var” to declare generic variable without specifying type, leading to runtime issue? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 28 days ago. Improve this question Hi: this code get compiled: But with runtime issue. The list local variable is of ArrayList but not any ArrayList<xxx> generic type. Why java let

Advertisement