摘要: 情景上这样的:我有一个重写了equals方法的类,该类源码如下。然后用一程序将此类多次循环put到HashMap中去,但每次put到1500次左右时,就会出现NullPointerException。
  
阅读全文
			posted @ 
2009-01-14 12:34 foxinsky 阅读(1847) | 
评论 (10) | 
编辑 收藏 
	
		
	
	
			
			     摘要: 先看下如下代码:
double dTest=82.545d;
      DecimalFormat format=new DecimalFormat("0.00");
      System.out.println(format.format(dTest));
你觉得会输出什么?82.55?还是82.54?  
阅读全文
			posted @ 
2008-11-17 16:50 foxinsky 阅读(2250) | 
评论 (2) | 
编辑 收藏 
	
		
	
	
			
			很奇怪哦,大家看一下这段代码
 NumberFormat numberFormat=NumberFormat.getNumberInstance();
  numberFormat.setMaximumFractionDigits(2);
  numberFormat.setMinimumFractionDigits(2);
  float f=5.535f;
  double d=5.535;
  System.out.println(numberFormat.format(f));  //输出值为?
  System.out.println(numberFormat.format(d));//输出值为?
看一下输出1 为5.53
而输出2 为5.54
有哪位兄台给我讲一下原因呢?
 
			
posted @ 
2008-09-04 13:55 foxinsky 阅读(858) | 
评论 (1) | 
编辑 收藏