Examples are as follows:
public class JsonExtracter { public static void main(String[] args) { String s = "{/"name/":/"a/",/"family/":[/"Zhang San/",/"Li Si/"]}"; JSONObject jsonObject = JSON.parseObject(s); //Note: The content in the family has brackets[], so it needs to be converted into an object of type JSONArray JSONArray family = jsonObject.getJSONArray("family"); for (int i = 0; i < family.size(); i++) { //Extract all Strings1 in the family = (String) family.get(i); System.out.println("currentFamily:" + s1); } }The above java method to extract all the values of an array in json is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.