Java Reference
In-Depth Information
31.
a
b
c
sum
sum = a + b + (
int
)c;
3
5
14.1
22
c /= a;
3
5
4.7
22
b += (
int
)c - a;
3
6
4.7
22
a *= 2 * b + (
int
)c;
48
6
4.7
22
33.
(NOTE: The user input is shaded.)
Enter last name: Miller
Enter a two digit number: 34
Enter a positive integer less than 1000: 340
Name: Miller
Id: 3417
Mystery number: 3689
35. The program require three inputs. One possible form of input is:
number
string
number
Another possible form of input is:
number string
number
Chapter 3
1. a. False; b. True; c. True; d. True
3. An object is an instance of a specific class.
5.
str
ΒΌ
new
String("Java Programming");
7. The
class
String
is contained in the package
java.lang
. If a program uses a
class contained in this package, the Java system automatically imports that class.
Therefore, because
class
String
is contained in the package
java.lang
,itis
not necessary to explicitly import this class using the import statement.
9.
a.
Going
b.
amusement
c.
GOING TO THE AMUSEMENT PARK
d.
going to the amusement park
e.
Going *o *he amusemen* park
11.
a.
false
b.
true
Search WWH ::
Custom Search