View Single Post
  #3 (permalink)  
Old 07-11-2007, 04:46 AM
ritwik07 ritwik07 is offline
Member
 
Join Date: Jul 2007
Posts: 4
ritwik07 is on a distinguished road
Quote:
Originally Posted by mary View Post
Because you are printing the result of comparing i with j, and the result will be boolean
If you want that it prints 1 or 0 you have to write it
Code:
int i=0; int j=10; If(i==j){System.out.println(1);}else {System.out.println(0);}
I know th use of 'if'. But the question is that
Code:
(i==j)
is a pure integer expression. Why does'nt it give an intger value???
Reply With Quote