一.collection接口 1.collection常用方法 点击查看代码 @Test public void test(){ //contains() Collection coll = new ArrayList(); coll.add(123); coll.add(456); coll.add(new String("Tom")); coll.add(false); Person p = new Person("jerry", 23); coll.add(p…
1.final关键字和.net中的const关键字一样,是常量的修饰符,但是final还可以修饰类.方法.写法规范:常量所有字母都大写,多个单词中间用 "_"连接. 2.遍历集合ArrayList<Integer> list = new ArrayList<Integer>();list.add(1);list.add(3);list.add(5);list.add(7);// 遍历List方法1,使用普通for循环:for (int i = 0; i <…