package cn.qmai.study.java.demo1;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 简单数组
 *
 * @author 宋欢
 */
public class SimpleArr {
    /**
     * Map初始容量
     */
    private static final int MAP_INITIAL_CAPACITY = 4;

    public static void main(String[] args) {
        Map<String, Object> book1 = new HashMap<>(MAP_INITIAL_CAPACITY);
        book1.put("id", 1);
        book1.put("name", "Java核心技术");

        Map<String, Object> book2 = new HashMap<>(MAP_INITIAL_CAPACITY);
        book2.put("name", "Java编程思想");
        book2.put("price", 108);

        Map<String, Object> book3 = new HashMap<>(MAP_INITIAL_CAPACITY);
        book3.put("id", 3);
        book3.put("name", "Java并发编程实战");
        book3.put("price", 47.5);

        List<Map<String, Object>> books = new ArrayList<>();
        books.add(book1);
        books.add(book2);
        books.add(book3);

        System.out.println(books);
    }

}
