r/java •

[deleted by user]

[deleted] — view deleted post

0 Upvotes

594 comments sorted by

View all comments

Show parent comment

5

u/Top_File_8547 Jun 10 '24

With later versions of Java you can do:

var userIdMap = new HashMap<String, User>();

So that cuts down on some repetitive code but you still know what type the map is.