I picked up a JS code for my assignment and I'm having problems achieving this in Java. My aim is to create predefined values of cities.
How can I convert this to Java, perhaps using Maps, I have an idea. i just don't know how to put this together perfectly.
* Removed JS code *
Map<String, Object> routes = new TreeMap<>(); routes.put("route1", "U"); routes.put("route2", "C"); routes.put("direction", Object); Map<String, Map<String, Object>> cities = new HasHMap<>(); cities.put("NewYork", routes.get("route1")); cities.put("LosAngeles", routes.get("route2"));