Given the definition of the Country class:
A. {EUROPE = [Italy, Germany], ASIA = [Japan]}
B. {ASIA = [Japan], EUROPE = [Italy, Germany]}
C. {EUROPE = [Germany, Italy], ASIA = [Japan]}
D. {EUROPE = [Germany], EUROPE = [Italy], ASIA = [Japan]}
Given the definition of the Country class:
A. {EUROPE = [Italy, Germany], ASIA = [Japan]}
B. {ASIA = [Japan], EUROPE = [Italy, Germany]}
C. {EUROPE = [Germany, Italy], ASIA = [Japan]}
D. {EUROPE = [Germany], EUROPE = [Italy], ASIA = [Japan]}
Question is very strange.
Javadoc says:
This (HashMap) class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time.
Running the code in Eclipse gives “A” as an answer and in IntelliJ “B”.
Not sure if this is a real OCA question.
The answer is A. tested.
But why not B. what makes the order Europe then Asia??
B
A
Note: The country class name should be same either “country” or “Country” everywhere.
B