example illustrates autoboxing and unboxing
来源:互联网 发布:迪恩网络模板 编辑:程序博客网 时间:2024/05/16 04:40
Design Patterns
Most developers claim to experience an epiphany reading this book. If you've never read the Design Patterns book then you have suffered a very serious gap in your programming education that should be remedied immediately.
The following example illustrates autoboxing and unboxing, along with generics and the for-each loop.
package test;
import java.util.*;
//Prints a frequency table of the words on the command line
public class Frequency {
public static void main(String[] args) {
Map<String, Integer> m = new TreeMap<String, Integer>();
for (String word : args) {
Integer freq = m.get(word);
m.put(word, (freq == null ? 1 : freq + 1));
}
System.out.println(m);
}
}
//这是计算输入的字符串,每一个词使用架频率.
//命令行输入:if it is to be it is up to me to do the watusi
//该结果应为:be=1, do=1, if=1, is=2, it=2, me=1, the=1, to=3, up=1, watusi=1
- example illustrates autoboxing and unboxing
- Autoboxing and Unboxing
- Autoboxing and unboxing
- Collection(七) Map -----autoboxing and unboxing
- autoboxing and auto-unboxing of JDK1.5
- What is autoboxing and unboxing in Java
- Java的Autoboxing and Unboxing(装箱拆箱)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- Java 自动装箱与拆箱(Autoboxing and unboxing)
- 孤独一生。。。悲伤的526
- Microsoft.XMLHTTP对象 和 AspHTTP组件
- 接口和抽象类的理解3
- 转: c#中与数据库打交道
- 一个动态交叉报表的例子
- example illustrates autoboxing and unboxing
- windows网络命令
- c#.net常用函数列表
- JDK5.0新特性
- 事务隔离级别示例代码
- MFC淡出效果核心代码
- WSE使用总结
- SSH的安装,配置,使用
- php session技术测试使用小结