会员
众包
新闻
博问
闪存
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
spring学习笔记
java例程练习(基础数据类型的包装类)
public class Test { public static void main(String[] args) { Integer i = new Integer(100); Double d = new Double("123.456"); int j = i.intValue() + d.intValue(); float f = i.floatValue() + d.floatValue(); System.out.println(j); System.out.println(f); double pi = Double.parseDouble("3.1415926"); double r = Double.valueOf("2.0").doubleValue(); double s = pi * r * r; System.out.println(s); try { int k = Integer.parseInt("1.23"); System.out.println(k); } catch (NumberFormatException e) { System.out.println("格式不正确"); } System.out.println(Integer.toBinaryString(123) + "B"); System.out.println(Integer.toHexString(123) + "H"); System.out.println(Integer.toOctalString(123) + "O"); } }
posted on
2012-04-30 16:00
spring学习笔记
阅读(
177
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
导航
博客园
首页
联系
订阅
管理
公告