我尝试解析此JSON,但未使用GSON进行解析。我将与您分享我的代码,请仅考虑作为解决该问题的补充解决方案:
String parse = "{"Person Id":"test","Last Name": "lname","First Name":"fname"}";try { JSonObject jsonObject = new JSonObject(parse); String id = jsonObject.getString("Person Id"); System.out.println("id="+id); System.out.println("lname="+jsonObject.getString("Last Name")); System.out.println("fname="+jsonObject.getString("First Name"));} catch (JSonException e) { e.printStackTrace();}


