Last active
June 8, 2017 09:24
-
-
Save tarek360/3d51225295ae0594743362dcd1008b89 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
public 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