5:21 am - Wednesday February 21, 2018

Example Program using JSONArray

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

BACK

                       This program explains about the concept of JSONArray and in addition output has been attached below.

Example Program

import java.io.FileWriter;

import java.io.IOException;

import org.json.JSONArray;

import org.json.JSONObject;

public class WriteJsontoFile

{

	public static void main(String[] args)

	{

		JSONArray list = new JSONArray();

		list.put("");

		list.put(new Integer(100));

		list.put(new Double(1000.21));

		list.put(new Boolean(true));

		System.out.print(list);

	}
}

Output

                [“”,100,1000.21,true]

BACK

Filed in: JSON Tutorial

Comments are closed.