I'm currently looking for a way in java to do something like c#. For example in ASP MVC you can write:
DoMethod(new {key = value, another = value2});
Is there any nice way to do this in java? I've tried just an array: new object[] {value, value...}
However that way i don't get the keys just the values.
I know you can do:
HashMap<String, object> map = new HashMap();
map.put("key", "value");
map.put("anoter", "value2");
DoMethod(map);
Unfortunately is that a cumbersome way if you need to do it a lot.
Cheers!