三者都是取得物件的長度的方法
length :
Arrays (int[], double[], String[]) — 取得Array的長度
int[] intArray = new int[20];
int lengthArray = intArray.length;
length():
String related Object (String, StringBuilder, etc) — 取得字串的長度
String iAmString = "iAmString";
int lengthString = iAmString.length();
size():
Collection Object (ArrayList, Set, etc) — 取得集合物件相關大小
ArrayList<String> iAmArrayList = new ArrayList<String>();
iAmArrayList.add("A1");
iAmArrayList.add("A2");
int lengthArrayList = lengthArrayList.size();