Skip to content

Commit f348190

Browse files
committed
JSONObject for Java example code added
1 parent d35ef20 commit f348190

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

languages/JavaAndroid.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,6 @@
131131
"checked": "checked"
132132
}
133133
}
134-
}
134+
},
135+
"exampleCode": "## Example\n\n\n#### Decoding:\nThe example below shows how to decode an instance of `<!RootClassName>` type from JSON object.\n\n```java\nString json = \"...\"; // Your JSON String.\n\nJSONObject jsonObj = new JSONObject(json);\n\n<!RootClassName> model = new <!RootClassName>(jsonObj);\n```\n\n\n#### Encoding: \nThe example below shows how to encode an instance of a simple `<!RootClassName>` type into a JSON object.\n> To use this remeber to check the `toJSONObject()` method.\n\n```java\n<!RootClassName> model = new <!RootClassName>();\n// Assign value to variables.\n\nJSONObject jsonObject = model.toJSONObject();\nSystem.out.println(jsonObject.toString());\n```\n\n###### Or\nIf you checked `toString()` method you can directly use: \n```java\nSystem.out.println(model.toString());\n```"
135136
}

0 commit comments

Comments
 (0)