beginner in java

As i am a beginner in java.i could not understand this program.this is a simple program of postfix and prefix increment operator.but i could not understand the output of this program.i understand the output of variable c and d but the output of a and b confuses me.if somebody please help me.pls help me so that i can move forward in java.thank you.

class in
public static void main(String args[])
int a = 3;
int b = 7;
int c = a++;
int d = ++b;
System.out.println("a = "+a);
System.out.println("b = "+b);
System.out.println("c = "+c);
System.out.println("d = "+d);

output is
a = 4
b = 8
c = 3
d = 8

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!