Java Reference
In-Depth Information
Parentheses increase the precedence of the operations contained within them, just like
in algebra. Use of redundant or additional parentheses will not cause errors or slow down
the execution of the expression. You are encouraged to use parentheses to make clear the
exact order of evaluation, both for yourself and for others who may have to figure out your
program later. For example, which of the following two expressions is easier to read?
Chapter 2 Self Test
1 . Why does Java strictly specify the range and behavior of its primitive types?
2 . What is Java's character type, and how does it differ from the character type used by
some other programming languages?
3 . A boolean value can have any value you like because any non-zero value is true.
True or False?
4 . Given this output,
using a single string, show the println( ) statement that produced it.
5 . What is wrong with this fragment?
Search WWH ::




Custom Search