Is it possible in Java to make a Dictionary with the items already declared inside it? Just like the below C# code:
Dictionary d = new
Java7 almost introduced "collection literals" that would allow syntax like that. They'll probably try to shove it in Java8. I have no idea what is wrong with these people.
This can be easily achieved by some kind of wrapper API
Map map = Maps.empty()
.put("cat", 2).put("dog",1)....;
Not too bad. I would prefer something like
map("cat", "dog", ... )
.to( 1, 2, ... );
This kind of thing must have been implemented by various people, unfortunately the standard API doesn't inculde such things.