In Python I’m using a dictionary display:
myAnonDict = {'foo': 23, 'bar': 'helloworld'}
Is there an equivalent in Java?
[edited ‘anonymous dictionary’ to read ‘dictionary display’]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is different from yours because yours has heterogeneous data types whereas mine deals in Strings only. You can actually have mixed collections in Java, too, but I hate doing that. Kind of defeats the purpose of strong typing.