because you display in row 17  the values of these variables, but in row 18 you 
display the values of these variables and after you increment this variables. 
If you want change value before to display make the following way:

  17. System.out.printl(j);//14
  18. System.out.printl(++j);//15
From: siva prasad <[email protected]>
Subject: [java programming] java Operators
To: [email protected]
Date: Thursday, August 13, 2009, 11:11 PM

public class TestOR {public static void main( String[] args ){int i = 0;int j = 
10;boolean test= false;
//demonstrate ||System.out.println(j++);//10test = (i < 10) | (j++ > 
9);//11System.out.println(i);System.out.println(j++);//12System.out.println(j++);//13 System.out.println(test);
 //demonstrate | test = (i < 10) || (j++ > 
9);//14 System.out.println(i); //System.out.println(j);//1 System.out.println(j);//14System.out.println(j++);//14 System.out.println(test);
 } }
O/p:
1001213true01414true

I couldnt understand y the value of j didnt change in the lines 17 & 18 of the 
above program.Pls suggest.

Thanks in AnticipationShiva.







      
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to