我有java函数,它以json格式返回输出
{"loyalty_score":{"End Value":0.0,"Difference":0.0},"activity_level":{"End Value":0.0,"Difference":0.0}}
我想获取对象的每个值
我尝试下面的代码
JSONObject json = new JSONObject();
json = fb.Summary();
System.out.print("\n\n\n Json"+json);
//{"loyalty_score":{"End Value":0.0,"Difference":0.0},"activity_level":{"End Value":0.0,"Difference":0.0}}
System.out.print( json.get("loyalty_score"));
//{End Value=0.0, Difference=0.0}
现在如何获得最终价值和差异?