java,如何 将json字符串 解析成对象 
			String test={"xxx": {"A": "AFASGSG", "B": 1}};
			
				莫回无
浏览 2421 回答 3 
			 
			
			
		 
		
		
		
			3回答 
			
				
				
					慕的地10843
					有一个叫fastjson的jar包 这个包的功能都齐全了json转listList<T> a = (T)JSONArray.parse(json);json转objectObject a = (Object )JSONObject.parse(json);
					
				 
				
				
					MMMHUHU
					下载这几个包,导入项目,JSONObject obj= new JSONOjbect().fromObject(test);JSONObject json= new JSONOjbect().fromObject(obj.getObject("xxx"));System.out.println(json.getString("A"));System.out.println(json.getString("B"));
					
				 
				
				
					慕勒3428872
					1、首先你那个json里还包含了一个json。2、定义两个json对象,JSONObject json1 = new JSONObject(); JSONObject json2 = new JSONObject();,注意下好json所需架包。3、json2.put("A", 'AFASGSG'); json2.put("B", 1); json1.put("tsr", json1); 这样json1就是你要的那种格式了
					
				 
				
			 
			
		 
		
			打开App,查看更多内容