NEW
Font size
S
M
L
XL
WorksheetsCh 3.5-10 Quiz
Total questions: 10
Worksheet time: 5mins
Name
Class
Date
1.
The
Java data type to store single characters is
a)
int
b)
double.
c)
char
d)
String
2.
The
Java data type that stores only two values,
which
are true
and
false,
is
a)
int
b)
double
c)
char
d)
boolean
3.
The
Java data type to store multiple characters is
a)
int
b)
double
c)
char
d)
String
4.
The
program statement c1 = c2 = c3 = ’Q’;
assigns
character ’Q’
to
a)
c1 only
b)
c2 only
c)
c3 only
d)
all 3 variables c1, c2, & c3
5.
Appending
two strings together in a manner like
“100”
+ “200” = “100200” is
called
a)
concatenation
b)
addition
c)
stringing
d)
parsing
6.
Which
of the following will add 1 to the value stored
in
the
integer variable x?
a)
x++;
b)
x
+= 1;
c)
x
= x + 1;
d)
All of the above
7.
A
good example of a "variable" that should be
declared
as a constant (final)
is
a)
your
job's pay rate.
b)
your
high school gpa.
c)
π (mathematical pi).
d)
the
number of years you go to college.
8.
The
formal name for Java’s simple data types is
a)
numeric
data types.
b)
text
data types.
c)
modern
data types.
d)
primitive
data types.
9.
An
example of a self-documenting identifier is
a)
k
b)
int
c)
hours worked
d)
100
10.
What is the output of this program segment?
final int num = 100; num = 200;
System.out.println(num);
a)
100
b)
200
c)
100 200
d)
compile error message
Reset
