zoukankan      html  css  js  c++  java
  • Java比较运算符

    注意哦:

    1、  > 、 < 、 >= 、 <= 只支持左右两边操作数是数值类型

    2、  == 、 != 两边的操作数既可以是数值类型,也可以是引用类型

    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));
    }
    }

  • 相关阅读:
    HDU 1198
    HDU 1863
    HDU 1879
    HDU 1233
    HDU 1232
    HDU 1829
    HDU 2473
    hdu 1829 A Bug's Life
    hdu 3038 How Many Answers Are Wrong
    hdu 1198 Farm Irrigation
  • 原文地址:https://www.cnblogs.com/JinQing/p/6224717.html
Copyright © 2011-2022 走看看