Java Reference
In-Depth Information
No, Java is a free-form language.
Chapter 2: Introducing Data Types and Operators
Java strictly specifies the range and behavior of its primitive types to ensure portabil-
ity across platforms.
some other programming languages?
Java's character type is
char
. Java characters are Unicode rather than ASCII, which
is used by some other computer languages.
True or False?
False. A boolean value must be either
true
or
false
.
use a single string to show the
println( )
statement that produced it.
There are two fundamental flaws in the fragment. First,
sum
is created each time the
block defined by the
for
loop is entered and destroyed on exit. Thus, it will not hold
its value between iterations. Attempting to use
sum
to hold a running sum of the iter-
ations is pointless. Second,
sum
will not be known outside of the block in which it is
declared. Thus, the reference to it in the
println( )
statement is invalid.