集合类都是可变的,为了安全,要让他们不可变,就必须对他们进行"改装",而不可修改的包装器(Unmodifiable Wrappers)就是改装他们的工具.
集合有三种: list ,set ,map,分别用以下3种包装器"改装". 一般用于将返回值中的集合类改装成不可变类型 不可修改的包装器会返回一个不可修改的集合,若对该集合进行修改操作,程序会在运行阶段报错,即这种操作并不会在编译阶段检测出来