I was wondering if there exists a similar functionality in Java similar to C#’s anonymous types:
var a = new {Count = 5, Message = "A string."};
Or does this concept go against the Java paradigm?
EDIT:
I suppose using Hashable() in Java is somewhat similar.
Maybe you mean sth like this:
@Commenters: of course this is a theoretical, very inconvenient example.
Probably OP may use
Map: