O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Answers to Questions

Q1 (a), (b), (c), and (e)

Only local variables need to be explicitly initialized before use. Fields are assigned a default value if not explicitly initialized.

Q2 (a), (d), and (e)

When the >> operator shifts bits to the right, it fills the new bits on the left with the bit value of the left-most bit of the original bit pattern. When the >>> operator shifts bits to the right, it always fills the new bits on the left with a bit value of 0. Thus, the >> and the >>> operators perform the same operation when the left-most bit of the original bit pattern has a bit value of 0. This occurs whenever the original value is non-negative.

The result of (-1 >> 1) is –1. A bit pattern consisting of all 1s (i.e., integer -1) will not change ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required