The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Unexpected result

Posted by Kannappan on November 26, 2000 at 10:15 AM

I wrote a simple Java program as follows (using jdk1.2)

class test
{
public static void main(String[] args){
int x;
x=0;
x=x++;
System.out.println(x);
}

}
It is giving me an output of 0 instead of 1. Could any one figure it out



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us