public class Increment { public static void main( String args[] ) { int x1 = 5 ; int y1 = 5 ; int z1 ; //x1 is still 5 and y1 becomes 6 so z1 is 11 z1 = x1++ + ++y1 ; //z1 11 //Now x1 is 6 y1 is 6 //z1 prints 11 System.out.println( "z1 = " + z1 ) ; //x1 is 6 and y1 is 6 z1 = x1++ + y1++ ; //z1 is 12 // x1 is now 7 and y1 is 7 System.out.println( "z1 = " + z1 ) ; z1 = x1 + y1 ; //z1 is now 14 System.out.println( "z1 = " + z1 ); //z1 is still 14 and will only change it's value // after the conditional expression if ( z1++ == 14 ) z1++ ; //After the conditional expression z1 is 15 and now we have another "++" so z1 is 16 ++z1 ; //Now z1 is 17 System.out.println( "z1 = " + z1 ) ; //17 } } //class