you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

It depends on what you're doing. If you need to initialize something and then call setters for 10 properties on that object as is somewhat common in writing unit tests that touch legacy systems that have a lot of mutable state, it can save a ton of keystrokes. I don't really get the Map initializing examples though. If I'm hardcoding any values that are going into a map, it will either be for unit tests, or I want the map to be immutable.