Java 中的操作符


Java 中的操作符

public class DemoJava {

   public static void main(String []args) {

      int a, b, c;

      a = 10;
      b = 20;

      c = a + b;   
      System.out.println("Value of c = " + c );

      c = a - b;
      System.out.println("Value of c = " + c );


      c = a * b;   
      System.out.println("Value of c = " + c );

      c = b / a;   
      System.out.println("Value of c = " + c );

      c = b % a;   
      System.out.println("Value of c = " + c );

      if( a == 10 ) {

         System.out.println("a is equal to 10" );
      }

   }
}