posted 21 years ago
(1)
Please have a look at the following code snippet :
1: int i = 45678;
2: int j = ~i;
3:
4: System.out.println(j);
Select 1 correct answer:
A. Compilation error at line 2.
B. Prints 45677.
C. Prints -45677.
D. Prints -45679.
Is there any shortcut method to get at the answer ?
(2)
write(0x01234567) is called on an instance of OutputStream, what will be written to the destination of the stream.
Ans given is the byte 0x67 but how? I kno that only lower order 8 bits are written to the underlying sink.