// purpose: show assignment implications public class SwappingValues { // method main(): program starting point public static void main( String[] args ) { // define two variables to try out some manipulation int x = 10; int y = 20; System.out.println( "x and y before manipulation" ); System.out.println( " x = " + x ); System.out.println( " y = " + y ); System.out.println(); // what happens when we try the following y = x; x = y; System.out.println( "x and y after manipulation" ); System.out.println( " x = " + x ); System.out.println( " y = " + y ); System.out.println(); System.out.println(); /* // define two more variables to try out some manipulation int a = 10; int b = 20; System.out.println( "a and b before manipulation" ); System.out.println( " a = " + a ); System.out.println( " b = " + b ); System.out.println(); // what happens when we try the following int remember = a; a = b; b = remember; System.out.println( "a and b after manipulation" ); System.out.println( " a = " + a ); System.out.println( " b = " + b ); */ } }