Answers for "convert a list of object to json in java"

2

how to get list from json object in java

JSONObject MyObject = new JSONObject(AllJson);
   JSONObject agac = MyObject.getJSONObject("agac-"+String.valueOf(b)); // b is a index in your list
   String agac_name  = agac.getString("agac-name");
   int agac_sayisi  = agac.getInt("agac-sayisi");
   double agac_carpani = agac.getDouble("agac-carpani");
   double agac_fiyat = agac.getDouble("agac-fiyati");
   int agac_level  = agac.getInt("agac-level");
Posted by: Guest on August-18-2021
0

how to convert a list of json to list of array

dataArray = [{"Value":10,"ValuePourcent":2},{"Value":20,"ValuePourcent":3},{"Value":51,"ValuePourcent":1}]

newFormat = dataArray.map(function(e){
                  return [e["Value"], e["ValuePourcent"]]
                  });
Posted by: Guest on March-17-2021

Code answers related to "convert a list of object to json in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language