Kuis 4
Kuis 4
Kuis 4
In a
Mark for Review
project, (1) Points
2 of the
classes
must
contain a
main
method.
True or
False?
True
False (*)
Correct
True
False (*)
Correct
Correct
Correct
5. When importing another package into a class you must
Mark for Review
import only the package classes that will be called and not (1) Points
the entire package. True or false?
True
False (*)
Correct
6.When
Mark for Review
importing
(1) Points
another
package
into a class
you must
import the
entire
package as
well as the
package
classes
that will
be called.
True or
False?
True
False (*)
Correct
Correct
Correct
double a=pow(8,5);
double a=15^8;
int a=Math.pow(5,8);
int a=Math.pow(8,5);
double a=Math.pow(5,8); (*)
Correct
Object
Rectangle
String
int (*)
Which
line of
Java
code
properly
casts
one type
into
another
without
data
loss?
Correct
12. Write a declaration statement that will hold a number like 2.541.
Mark for
Review
(1) Points
int number;
float number; (*)
boolean number;
char number;
Correct
\\
\\\\\\\\\\\\\\
\\\\
\\\\\\\ (*)
Correct
\\\\ (*)
\\\\\\\\
"\\\\\"
\\
Correct
""\
""
\
""
\
"
\
" (*)
\" \"
"
\
"
\
"
"
Correct
1 The
Mark for
. followi
Review
ng
(1) Points
define
s an
import
keywo
rd:
Defines where this class lives relative to other classes, and provides a
level of access control.
Correct
2. Which of the two diagrams below illustrate the general form of a Java
Mark for
program?
Review
(1) Points
Example A
Example B (*)
Correct
3. The following defines a class keyword:
Mark for
Review
(1) Points
Defines where this class lives relative to other classes, and provides a
level of access control.
Correct
Defines where this class lives relative to other classes, and provides a
level of access control.
Correct
16
-9 (*)
0
Correct
Correct
zero
2bad (*)
theLastValueButONe
year2000
Correct
9. A local variable has precedence over a global variable in a Java method. True or
false? Mark for Review
(1) Points
True (*)
False
Correct
s3 == s1 (*)
s1 = s2
s1 == s2
s3.equals(s1)
s1.equals(s2)
Correct
11.The ==
Mark for
operator
Review
can be
(1) Points
used to
compare
two String
objects.
The result
is always
true if the
two
strings are
have the
exact
same
characters
in each
position
of the
String.
True or
false?
True
False (*)
Correct
What is printed?
Black
Forest
5 (*)
Correct
13. Multiple windows are used when more than one file is open in
Mark for Review
the edit area. True or False?
(1) Points
True
False (*)
Correct
14. The ______________ is the location into which you will store and
Mark for Review
save your files.
(1) Points
Perspective
Workspace (*)
Editor
Correct
True
False (*)
Correct