而如果上述代码我们增加上泛型,就会在编译期就能看到明显的错误啦。 List<String> list = new ArrayList<>(); list.add(1); // 报错Required type:String ...
確定! 回上一頁