Java
TTTtavel
..
展开
-
【基础】求商运算的坑
1、做一个视频高度的计算,如下。结果这值等于360。。。。。。720 / 600 * 360 = 3602、因为,与int相关的除法规则是这样720(int) / 600(int) = 1720(float) / 600(int) = 1.2720(double) / 600(int) = 1.2720(int) / 600(float) = 1.2720(int) / 600(doubl原创 2016-12-02 11:11:02 · 3243 阅读 · 0 评论 -
【基础】java泛型(持续补充)
1、泛型中 ?、T、K、V、E 代表的意思如下: K表示键 ; V表示值 ; T表示type类型 ;E表示enum枚举 ; ?表示不确定的类型。 但这些都是java的规范,没有强制要求要用这几个字母。原创 2016-12-07 11:38:28 · 185 阅读 · 0 评论 -
【Guava】参数检查工具包Preconditions
1、示例try{ this.num = Preconditions.checkArgument(num>0, "num要大于0");}catch(Exception e){ // todo}try{ this.num = Preconditions.checkNotNull(num, "num不能为0");}catch(Exception e){ // todo原创 2016-12-09 16:47:49 · 447 阅读 · 0 评论 -
【Guava】Guava介绍
【转自 http://www.cnblogs.com/peida/archive/2013/06/08/3120820.html】1、Guava 是一个 Google 的基于java1.6的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency libraries, common annotations, string p原创 2016-12-08 12:09:49 · 333 阅读 · 0 评论