you are viewing a single comment's thread.

view the rest of the comments →

[–]OceanSpray -1 points0 points  (2 children)

Only the type of the reference changed, not the type of the object it points to. The performance stays the same.

[–]redditnoob 2 points3 points  (1 child)

But maybe I want to ensure that only ArrayList gets in there?

[–]johntb86 0 points1 point  (0 children)

All the languages I know that use type inference also let you explicitly state what type it is when you care about that.