注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
- {
- "GB": {
- "birmington": {"apple": "20", "google": "50", ....},. more info on 1point3acres.com
- "london": {"apple": "110", "google": "70", ....},
- },
- "US": {
- "new york": {"apple": "100", "google": "200", ....},
- "san francisco": {"apple": "150", "google": "50", ....},
- },
- ....
- ....
- }
- columns: ['country', 'city', 'store', 'rev']
- output:
- [{"city": "london", "country": "GB", "rev": "70", "store": "google"},
- {"city": "london", "country": "GB", "rev": "110", "store": "apple"},
- {"city": "birmington", "country": "GB", "rev": "50", "store": "google"},
- {"city": "birmington", "country": "GB", "rev": "20", "store": "apple"},
- {"city": "san francisco", "country": "US", "rev": "50", "store": "google"}, ....]
- m cols n row
- input: JSON apiData, String[] columns.
-
- output: List<Hashtable<String, String>>
- */
- interface JSON { // base class for json data type
- public JSON(String json); // constructor
- public String toString(); // convert json data type to string that can be printed
- public String type(); // return type
- }
- class JSONMapping extend JSON {
-
- public JSON get(String key); // return value corresponding to the key
- public String[] keys(); // return all the keys
- public String type() {return "JSONMapping";}
- }
-
- class JSONString extend JSON {
- public String value(); // return the string
- public String type() {return "JSONString";}
复制代码 [size=11.000000pt]第二题是一道新题 你 有 [size=11.000000pt]json object json object [size=11.000000pt]可能会包[size=11.000000pt]的一堆函数啥的 电话面试必考题
|