2. คำนวณ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 2-1  ตัวอย่างการใช้ตัวดำเนินการคำนวณ + - * และ /
public class Operators {
  public static void main(String[] args) {
    System.out.println( 4+2 );
    System.out.println( 4-2 );
    System.out.println( 4*2 );
    System.out.println( 4/2 );
    System.out.println( 1+2+3+4+5+6+7+8+9+10 );
  }
}
©2009 S.Prasitjutrakul