|
-
Apr 14th, 2001, 07:52 PM
#1
Thread Starter
Dazed Member
Quick Question........
This is one of the practice questions i came accross
while reading a book on the Java2 cert exam
and it's driving me crazy because i think the
book is wrong........
6.) What is the output displayed by the following program?
class Question{
public static void main(String [] args){
int n = 7;
n <<=3;
n = n & n + 1 | n + 2 ^ n + 3;
n >>= 2;
System.out.println(n);
}
}
possible answers:
A. 0
B. -1
C. 14
D. 64
the book says:
the answer is C
the variable n takes on the
values 7,56,57, and then 14.
the answer i get is 235.
thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|