Your First Java Program Solutions
From CompSciWiki
- ...
- ...
- Escape sequences exist because the characters they represent either cannot be typed on the keyboard, or have no single-character representation.
- The results of the casts are (errors indicated where necessary):
-
50
-
25L
(casting does not round, it merely drops the decimal portion) -
55000000000000000L
- Error,
1.23e240
is outside the range offloat
types. - Error,
2500000000L
is outside the range ofint
types -
6.789E7
-
600.0
-
-
Recall that escape characters such as
\\
and\n
may look longer than they really are. They are interpreted by the computer as single characters.- 19
- 16
- 10
- ...
- ...