net.sf.JSONArray

Addrees类和上篇net.sf.JSONObject

例子中用的是同一个类

package com.dean.test;
import com.dean.Address;

import net.sf.json.JSONArray;

public class Test {

    public static void main(String[] args) {
        Address address = new Address();
        address.setNo("1068");
        address.setProvince("桃源省");
        address.setRoad("东篱路");
        address.setStreet("南山街");
        JSONArray json = JSONArray.fromObject(address);
        System.out.println(json);
    }

}

你可能感兴趣的:(java)