// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import org.json.JSONArray;
import org.json.JSONObject;

public class JsonParse {
    public static void main(String[] args) {
        String json = "{\"ValidateUserByUGUIDResult\":[{\"UserIsValidated\":true}]}";
        System.out.println(json);
        JSONObject obj = new JSONObject(json);
        JSONArray vup = obj.getJSONArray("ValidateUserByUGUIDResult");
        for(int i = 0; i < vup.length(); i++) {
            JSONObject elm = vup.getJSONObject(i);
            boolean isval = elm.getBoolean("UserIsValidated");
            System.out.println(isval);
        }
    }
}
