public class Example3-3IF

  public static void main(String args[])
  {
    int a=9,b=5,c=7,t;
    if(a>b)
    {
       t=a;a=b;b=t;
    }
     if(a>c)
     {
     t=a;a=c;c=t;
     }
     
     if(b>c)
     {
     t=b;b=c;c=t;
     } 
     System.out.println("a="+a+",b="+b+",c="+c);
    }
   
}
怎么是23行错误 说是缺少 “{ }”但是我的“{ }”是正确的啊~

解决方案 »

  1.   

    确实是类名有错,Java中标示符只能是字母,数字,下划线和美元符号的任意组合,数字不能是第一个。别的地方没有错。
      

  2.   

    把类名改一下吧,Example3-3IF应该是-的问题!
      

  3.   

    public class Example3-3IF定义错误
    public class example3

      public static void main(String args[])
      {
        int a=9,b=5,c=7,t;

        if(a>b)
        {
           t=a;a=b;b=t;
        }
         if(a>c)
         {
         t=a;a=c;c=t;
         }
         
         if(b>c)
         {
         t=b;b=c;c=t;
         } 
         System.out.println("a="+a+",b="+b+",c="+c);
        }
       
    }