public static void main (String [] arg) {
int x,y;
x=6;
y=x++;
System.out.println ("Hasil y=x++");
System.out.println ("y ="+y+",x ="+x);
System.out.println ("");
x=6;
y=++x;
System.out.println ("Hasil y=++x");
System.out.println ("y ="+y+",x ="+x);
System.out.println ("");
x=6;
y=x--;
System.out.println ("Hasil y=x--");
System.out.println ("y ="+y+",x ="+x);
System.out.println ("");
x=6;
y=--x;
System.out.println ("Hasil y=--x");
System.out.println ("y ="+y+",x ="+x);
}
}
Tidak ada komentar:
Posting Komentar