Java HashMap get works but containsKey does not
问题 I am trying to locate a key in a HashMap. I can print the selected key by using 'get' but when I use 'containsKey' in an if statement, it is not found. I KNOW the key is present in the Map but it keeps returning false. Any ideas people? My code: public static boolean checkLowerStructuralSupport(Location location) { boolean hasSupport = false; Location supportingLocation = new Location(location.getX(), location.getY(), location.getZ() - 1); System.out.println(_levels.get(supportingLocation