| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 727 人关注过本帖
标题:按照 视频教程 写得 但是出错了 实在不知道哪儿出错了
只看楼主 加入收藏
wenxx10
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2008-8-4
收藏
 问题点数:0 回复次数:3 
按照 视频教程 写得 但是出错了 实在不知道哪儿出错了
class bl2
{
            public static void main(String [] args)
            {
                        int x=12;
                        {
                            if(x<3)
                                        System.out.println("x<3");
                                        System.out.println("ok");
                            else if(x>=3 && x<8)
                                        System.out.println("x>=3 && x<8");
                        }
              int y;            
                        /*if(x>0)
                                        y=x;
                        else
                                        y=-x;*/
                        y=x>0?x:-x;
                    
                        if(x==1);
                                    {
                                    if(y==1)
                                    {
                                                System.out.println("x==1,y==1");
                                    }
                                    else
                                    {
                                                System.out.println("x==1,y!=1");
                                  }
                                  }
                      else if(x>3)    
                                  {
                                  if(y==1)
                                    {
                                                System.out.println("x!=1,y==1");
                                    }
                                    else
                                    {
                                                System.out.println("x!=1,y!=1");
                                    }
                                    }
                        
                        x=1;
                        switch(x)
                        {
                                        case 1:
                                                        System.out.println("switch1");
                                        case 2:
                                                        System.out.println("seitch2");
                                        default:
                                                        System.out.println("other");
                        }              
            }
}

[[it] 本帖最后由 wenxx10 于 2008-8-18 13:45 编辑 [/it]]
搜索更多相关主题的帖子: 视频 教程 ultra args int 
2008-08-18 13:40
wenxx10
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2008-8-4
收藏
得分:0 
来人啊
2008-08-18 18:24
huwangvs
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:34
帖 子:764
专家分:0
注 册:2007-2-4
收藏
得分:0 
不知道是你敲错了,还是视频就这样的。。。。
自己学着看错误提示来修改。。。

class bl2
{
            public static void main(String [] args)
            {
                        int x=12;
                        {
                            if(x<3){
                                        System.out.println("x<3");
                                        System.out.println("ok");
                            }
                            else if(x>=3 && x<8)
                                        System.out.println("x>=3 && x<8");
                        }
              int y;            
                        /*if(x>0)
                                        y=x;
                        else
                                        y=-x;*/
                        y=x>0?x:-x;
                    
                        if(x==1)
                                    {
                                    if(y==1)
                                    {
                                                System.out.println("x==1,y==1");
                                    }
                                    else
                                    {
                                                System.out.println("x==1,y!=1");
                                  }
                                  }
                      else if(x>3)   
                                  {
                                  if(y==1)
                                    {
                                                System.out.println("x!=1,y==1");
                                    }
                                    else
                                    {
                                                System.out.println("x!=1,y!=1");
                                    }
                                    }
                        
                        x=1;
                        switch(x)
                        {
                                        case 1:
                                                        System.out.println("switch1");
                                        case 2:
                                                        System.out.println("seitch2");
                                        default:
                                                        System.out.println("other");
                        }              
            }
}
2008-08-18 19:06
wenxx10
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2008-8-4
收藏
得分:0 
多谢了!
2008-08-18 19:31
快速回复:按照 视频教程 写得 但是出错了 实在不知道哪儿出错了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036805 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved