Jumat, 05 April 2013

Contoh Program Java Decrement


class DemoDecrement {
  public static void main(String[] args) {


    int a=5;

    System.out.println("Pre-decrement");
    System.out.println("a\t: " + a);
    System.out.println("--a\t: " + --a);
    System.out.println("a\t: " + a);

    int b=5;

    System.out.println("\nPost-decrement");
    System.out.println("b\t: " + b);
    System.out.println("b--\t: " + b--);
    System.out.println("b\t: " + b);
  }
}

Tidak ada komentar:

Posting Komentar