sooxin-JAVA

两个整数相除得到小数(JAVA)

结果完全不一样

        public class test{
                public static void main(String[] args){
                        double x = 1/4;
                        System.out.println(x+"");    
             }    
        }


  public class test{
                public static void main(String[] args){
                      double x = (double)1/4;
                      System.out.println(x+"");
                }   
     }  

  是变笨了还是。。。
  基础不牢,唯一的解释。

posted on 2007-11-24 15:13 sooxin 阅读(2839) 评论(0)  编辑  收藏 所属分类: JAVA


只有注册用户登录后才能发表评论。


网站导航: