package maoxiang.examples.jdk15;
import java.util.AbstractList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* @author 毛翔
*
* box 将primitive 类型转换成复合对象 ,如将int 转换成Integer
* unbox 将复合对象转换成primitive Integer.intValue()
*/
public class AutoBoxing {
public static void main(String[] args) {
AutoBoxing test = new AutoBoxing();
test.Test1();
}
public void Test1() {
String[] args = new String[] { "1", "2", "3", "4", "5", "6", "7", "8" };
Map<String, Integer> m = new TreeMap<String, Integer>();
for (String word : args) {
Integer freq = m.get(word);