JAVA Series -> Comparison Operators

First, review the section focuses on arithmetic operators
what Consider the following code, the result is?

public class Test {
    public static void main(String[] args){
        int i=1;
        int a=i++;
        int j=1;
        int b=++j;
        System.out.println(i);
        System.out.println(a);
        System.out.println(j);
        System.out.println(b);
    }
}

Run your own answers come after inspection

Comparison Operators

Comparison operators: calculates comparison data between the two, the return value of type Boolean (true or false).
Here Insert Picture Description

For example as follows:

 public static void main(String[] args) { 
      System.out.println(100==100);//true
      System.out.println(100<200);//true
      System.out.println(300>400);//false
      System.out.println(300<=400);//true
      System.out.println(300>=400);//false
      System.out.println(300!=400);//true 
}
Published 37 original articles · won praise 24 · views 670

Guess you like

Origin blog.csdn.net/qq_16397653/article/details/103601011