1、java map
import java.util.*; public class CollectionsDemo { public static void main(String[] args) { Map m1 = new HashMap(); m1.put("Zara", "8"); m1.put("Mahnaz", "31"); m1.put("Ayan", "12"); m1.put("Daisy", "14"); System.out.println(); System.out.println(" Map Elements"); System.out.print("\t" + m1); } }
以上实例编译运行结果如下:
Map Elements
{Mahnaz=31, Ayan=12, Daisy=14, Zara=8}
见下面的程序及输出:
2、JavaScript json
var person={“name”:”tom”,”sex”:”男”,”age”:”24″}//json对象
var person='{“name”:”2323″,”sex”:”afasdf”,”age”:”6262″}’;//json字符串
也就是说,json的格式是: