List<Integer> a=new ArrayList<Integer>();
a.add(1);
System.out.println(a.size());
int b[]={1,2,3};
System.out.println(b.length);
String s=new String("Hello");
System.out.println(s.length());
out: 1 3 5
泛型 size()
数组 length
字符串 length()
out: 1 3 5
泛型 size()
数组 length
字符串 length()