Created
June 8, 2017 09:20
-
-
Save tarek360/20c229436a2b340b12a77e970818f3e2 to your computer and use it in GitHub Desktop.
This file contains 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
JSONObject toJson() { | |
JSONObject jsonObject = new JSONObject(); | |
try { | |
jsonObject.put("modelNumber", modelNumber); | |
jsonObject.put("maxSpeed", maxSpeed); | |
jsonObject.put("color", color); | |
jsonObject.put("manufacturer", manufacturer); | |
jsonObject.put("style", style); | |
jsonObject.put("price", price); | |
} catch (JSONException e) { | |
e.printStackTrace(); | |
} | |
return jsonObject; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment