问答详情
源自:3-4 Java中的比较运算符

为啥结果不对?

HelloWorld.java

public class HelloWorld{  

  public static void main(String[] args) {  

      int a=16;      

     double b=9.5;        

     String str1="hello";    

     String str2="imooc";       

     System.out.println("a等于b:" + (a  == b));    

     System.out.println("a大于b:" + (a >  b));  

     System.out.println("a小于等于b:" + (a <=  b)); 

      System.out.println("str1等于str2:" + (str1  == str2));   

 }

}



error: ')' expected
System.out.println("a??b?" + (a b));
^
error: ';' expected
System.out.println("a??b?" + (a b));
^
error: ')' expected
System.out.println("a????b?" + (a b));
^
error: ';' expected
System.out.println("a????b?" + (a b));
^
error: ')' expected
System.out.println("str1??str2?" + (str1 str2));
^
error: ';' expected
System.out.println("str1??str2?" + (str1 str2));
^
6 errors

提问者:梦醒了 2015-07-11 17:50

个回答

  • 岳阳白少
    2015-09-11 15:57:15

    服务器延时!

  • 梦醒了
    2015-07-11 17:53:30

    刷新出来了