Given I am checking my hashmap as follows
String firstName = map.get(UserDetail.FIRST_NAME); String lastName = map.get(UserDetail.LAST_NAME); String age = map.get(UserDetail.AGE); double height = Double.parseDouble(map.get(UserDetail.HEIGHT) double weight = Double.parseDouble(map.get(UserDetail.WEIGHT) String email = map.get(UserDetail.EMAIL); How would I check that the key actually exists in my hashmap before attempting to retrieve the value. At the moment I keep getting a NullPointerException regularly.