Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Create Json Array in Liferay

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.60k
    Comment on it

    Hello guys,

    JSON is a collection of name/value pairs, and it's in various languages, JSON is like as an object, record, struct, dictionary, hash table, keyed list, or associative array. JSON is an ordered list of values and in many languages, it is realized as an array, vector, list, or sequence. JSONArray can store multiple JSONObject in various data types i.e int,boolean,String etc.


    Below example will help you to create JSONArray.

          JSONArray jsonArraylab=JSONFactoryUtil.createJSONArray();
              for(int i =0; i<=10;i++){
            JSONObject jsonObjlab = JSONFactoryUtil.createJSONObject();
            jsonObjlab.put("labName","labName");
            jsonObjlab.put("labid","labid";
            jsonArraylab.put(jsonObjlab);
        }
        System.out.println("lab name   "+jsonArraylab.toString());
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: