Quiz 7
Quiz 7
Quiz 7
Incorrect
Consider
Correct
Correct
3.
tly?
Mark for Review
(1) Points
ThisClass t=new ThisClass(); int x=t.calculate(3,4); (*)
Correct
Correct
4.
A team is working on a coding project. They desire that
all portions of their code should have access to the classes that they write. Wh
at access modifier should be used for each class?
Mark for Review
(1) Points
public (*)
protected
private
default
All of the above
Incorrect
Mark fo
r Review
(1) Points
There is no such thing as overloading.
The code has to be declared as private.
Java Virtual Machine searches until it finds a constructor name and argu
ment type match. (*)
The interpreter doesn't care what you name your constructors.
Incorrect
Page 1 of 3
6.
Next
Summary
(1) Points
(Choose all correct answers)
Objects (*)
Constructors
Strings (*)
Integers (*)
Arrays (*)
Incorrect
r Why not?
HousePet Scooby = new Dog();
(1) Points
Maybe. There is no way to tell without seeing the methods for Dog and th
e methods for HousePet.
No, because ref must be declared either a HousePet or a Dog, but not bot
h.
Yes, because it is an abstract class.
Yes, because polymorphism allows this since Dog is a subclass of HousePe
t. (*)
Correct
Correct
8.
Mark for Review
(1) Points
Incorrect
9.
Abstract classes cannot implement interfaces. True or fa
lse?
Mark for Review
(1) Points
True
False (*)
Incorrect
10.
Consider creating a class Square that extends the Rectan
gle class provided below. Knowing that a square always has the same width and le
ngth, which of the following best represents a constructor for the Square class?
(*)
None of the above.
Correct
Correct
Previous
Page 2 of 3
Next
Summary
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Section 7 Quiz
(Answer all questions in this section)
11.
Methods are generally declared as public so other classe
s may use them. True or false? Mark for Review
(1) Points
True (*)
False
Correct
Correct
12.
(1) Points
(Choose all correct answers)
There is no such thing as a Java Applet.
It is the virtual machine that translates Java code into a representatio
n that the computer can understand.
A web-based Java program that is embedded into a web browser. (*)
A graphic visual included in Java. (*)
Incorrect
13.
Static classes can exist as inner classes. True or false
?
Mark for Review
(1) Points
True (*)
False
Correct
Correct
14.
Static classes can't return instances of the parent clas
s when the parent class uses a private constructor. True or false?
Mark fo
r Review
(1) Points
True
False (*)
Incorrect
ue or false?
(1) Points
True
False (*)
Incorrect
Previous
Summary