Created
December 2, 2014 18:50
-
-
Save BlakeBarrett/6f85c911af3d6798310e to your computer and use it in GitHub Desktop.
Java / JSON Interview Question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find as many errors as possible with this method | |
/** | |
* Is the specified user an admin? | |
*/ | |
public Boolean isUserAdmin(final JSONObject userJson) { | |
final String userType = userJson.getString("user_type"); | |
if (userType.equals("admin")) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment