Can you explain me how the static works in this example?
shoeb sayyed
Ranch Hand
Joined: Mar 14, 2010
Posts: 48
posted
0
This message was edited 1 time. Last update was at by Devaka Cooray
Thanks,
Shoeb
Vasiq Molvizadah
Ranch Hand
Joined: Dec 24, 2009
Posts: 66
posted
0
The reason why you are getting the value of j as 4 is because ....in the following line :
you used an Conditional OR Operator ..this operator exhibit "short-circuiting" behavior, which means that the second operand is evaluated only if needed. In this case the first condition is i< 10 which is true ...so it won't check the second operand.....and that's the reason why you are getting the value of j as 4....
Hope this is the answer to your question...
This message was edited 1 time. Last update was at by Vasiq Molvizadah
Howdy shoeb, welcome to JavaRanch Please UseCodeTags when you post a source code in future. It's unnecessarily hard to read the code otherwise.
For now, I've added the code tags on your post for you.