阅读290 返回首页    go 阿里云 go 技术社区[云栖]


jdk1.5新特性1之静态导入


调用Math类的静态方法,每次都要写Math点方法。

public static void main(String args)
{
 system.out.print(Math.max(3,6));
 system.out.print(Math.min(3.6));
}

 


JDK1.5支持静态导入

import static java.lang.Math.max;

public static void main(String args)
{
 system.out.print(max(3,6));
}

当然这样导入就更可以了import static java.lang.Math.*;

 

最后更新:2017-04-03 07:57:27

  上一篇:go Windows 8不得不说的13个特色功能
  下一篇:go Oracle中的LOB数据类型以及ibatis中处理该类型的typeHandler