Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Q&A 117

Q&A


Q. Is the numeric range of the alphabet,from 65 for A to 90 for Z,part of
the basic Java language? If so,what are 1 through 64 reserved for?
A. The numbers 1 through 64 include numerals,punctuation marks,and
some unprintable characters,such as linefeed,newline,and backspace. A
number is associated with each printable character that can be used in a
Java program,as well as some unprintable ones. Java uses the Unicode
numbering system. The first 127 characters are from the ASCII character
set,which you might have used in another programming language.

Q. Why are some errors called exceptions?
A. The significance of the term is that a program normally runs without any
problems,and the exception signals an exceptional circumstance that
must be dealt with. Exceptions are warning messages that are sent from
within a Java program. In the Java language,the term erroris sometimes
confined to describe error conditions that take place within the interpreter
running a program. You learn more about both subjects during Hour 18.

Q. In a multidimensional array,is it possible to use the lengthvariable to
measure different dimensions other than the first?
A. Yo u c a n t e s t a ny d i m e n s i o n o f t h e a r r ay. Fo r t h e f i r s t d i m e n s i o n ,use
lengthwith the name of the array,as in x.length. Subsequent dimen-
sions can be measured by using lengthwith the [0]element of that
dimension. Consider an array called datathat was created with the fol-
lowing statement:
int[][][] data = new int[12][13][14];
The dimensions of this array can be measured by using the
data.lengthvariable for the first dimension,data[0].lengthfor the
second,and data[0][0].lengthfor the third.

Q. Why does New England Patriots head coach Bill Belichick always wear
that ridiculous hoodie on the sidelines?
A. Sportswriters believe that Belichick began wearing the attire in
response to an NFL deal with Reebok that required all coaches to wear
licensed team apparel.
“He decided that if they were going to make him wear team apparel
then he’d sift through the options and put on the absolute ugliest thing
he could find,” Dan Wetzel of Yahoo! Sports explained in 2007. “He
chose a grey sweatshirt,often with a hood.”
Belichick’s passive-aggressive fashion statement has turned the hoodie
into one of the team’s best-selling items.
Free download pdf