|
-
October 22nd, 2004, 05:10 PM
#1
a=a++;
I am surprised by the output of the following Java code. Normally, I would not do "a=a++;". But I just could not explain why the "a=" would yield a wrong result.
Please help.
=============================================
import java.io.*;
public class Test {
public static void main (String args[]) {
int a = 1;
System.out.println(a);
a=a++;
System.out.println(a);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|