Compound Assignment Operators : Assignment Operators « Operators « SCJP






> greater than

>= greater than or equal to

< less than

<= less than or equal to

public class MainClass {
  public static void main(String[] args) {
    int weight = 700;
    char sex = 'm';
    double myDouble = 1.6;
    if (weight >= 500) {
      System.out.println("weight >= 500");
    }
    if (myDouble > 1.6) {
      System.out.println("myDouble > 1.6");
    }
    if (sex <= 'f') {
      System.out.println("sex <= 'f'");
    }
   
  }
}
weight >= 500








2.10.Assignment Operators
2.10.1.Assignment Operator Summary
2.10.2.Compound Assignment Operators
2.10.3.An arithmetic operator with = perform an operation on the variable on the left side and store the results in the variable.
2.10.4.a = b = c is evaluated as a = (b = c).
2.10.5.Simple assignment uses =
2.10.6.Assignment operators include an implicit cast.
2.10.7.Java uses the + and += operators to indicate concatenation for string values.
2.10.8.compound additive operator (+=) and Strings