Java Array
doc : https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html
int[] a = new int[256];
Arrays.sort(a) 升序排列
Arrays.fill(a, -1)
Java List
doc : https://docs.oracle.com/javase/7/docs/api/java/util/List.html
List<String> list = new ArrayList<String>();
list.add("a");
for(String str : list) {
System.out.println(str);
}
for(int i; i<list.size();i++){
System.out.println(list.get(i));
}
Iterator<String> iter = list.iterator();
for(iter.hasNext()){
iter.next();
System.out.println(iter.next());
}
Java Map
doc : https://docs.oracle.com/javase/7/docs/api/java/util/Map.html
Map<String, String> map = new HashMap<String, String>();
map.put("A","a");
for (Map.Entrys : map.entrySet()) { //s.getKey() s.getValue() System.out.println("键值对:" + s); } for (String s : map.values()) { System.out.println("values:" + s); } for (String s : map.keySet()) { System.out.println("key:" + s); System.out.println("values:" + map.get(s)); }
String 类
https://docs.oracle.com/javase/7/docs/api/java/lang/String.html
Integer 类
https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html
String 转 Integer
Integer.parseInt(str)
Integer.valueOf(str)
Integer 转 String
Integer.toString(i)
String.valueOf(i)