--- title: '把json轉成java物件' disqus: hackmd --- ###### tags: `Ads API` `Google Ads` 把json轉成java物件 === [TOC] ## 筆記目的 大致了解怎麼把API的東西轉乘概念 ## 應用情況  ## 程式碼部分 ```java= private void name(String response) { JSONObject object = new JSONObject(response); String kind = object.getString("kind");//kind = abc JSONArray array = object.isNull("owners") ? new JSONArray() : object.getJSONArray("owners"); for (int i = 0; i < array.length(); i++) { JSONObject abc = array.getJSONObject(i); String pId = abc.isNull("Pid") ? "" : abc.getString("Pid"); } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up