@Test public void txfloat() { // TODO 自动生成的方法存根 int a=9; int b=7; DecimalFormat df=new DecimalFormat("0.00"); System.out.println(df.format((float)a/b)); System.out.println(df.format(a/(float)b)); System.out.println(df.format((float)a/(float)b));
转自:http://blog.csdn.net/sunboy_2050/article/details/7310008 版权声明:本文为博主原创文章,未经博主允许不得转载. Java基本数据类型int 32bitshort 16bitlong 64bitbyte 8bit char 16bitfloat 32bitdouble 64bit boolean 1bit,This data type represents one bit of information