You are on page 1of 7

1. When would an enum (or enumeration) be used?

Mark for
Review
(1) Points

When you want to be able to create any number of objects of that class.

When you wish to initialize a HashSet.

When you wish to remove data from memory.

When you already know all the possibilities for objects of that class. (*)

m
er as
[Correct] Correct

co
eH w
2. < ? extends Animal > would only allow classes or subclasses of Animal

o.
to be used. Mark for Review
(1) Points
rs e
ou urc
True (*)
o
aC s

False
vi y re

[Correct] Correct
ed d
ar stu

3. Which of the following correctly initializes an object named cell of the


class Telephones whose generic type is Cellular? Mark for Review
(1) Points
is

Telephones cell = new Telephones(Cellular c);


Th

Telephones(Cellular) cell = new Telephones(Cellular);


sh

Telephones<> cell = new Telephones<>(Cellular c);

Telephones cell = new Telephones(); (*)

None of the above.

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
[Correct] Correct

4. The instanceof operator is a boolean comparison operator. True or false?


Mark for Review
(1) Points

True (*)

False

[Correct] Correct

m
er as
co
5. An abstract class can be instantiated. Mark for Review

eH w
(1) Points

o.
True
rs e
ou urc
False (*)
o
aC s
vi y re

[Incorrect] Incorrect. Refer to Section 2 Lesson 2.


ed d
ar stu

1. When would an enum (or enumeration) be used? Mark for


Review
(1) Points
is

When you want to be able to create any number of objects of that class.
Th

When you wish to initialize a HashSet.


sh

When you wish to remove data from memory.

When you already know all the possibilities for objects of that class. (*)

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
[Correct] Correct

2. < ? extends Animal > would only allow classes or subclasses of Animal
to be used. Mark for Review
(1) Points

True (*)

False

[Correct] Correct

3. Which of the following correctly initializes an object named cell of the

m
er as
class Telephones whose generic type is Cellular? Mark for Review
(1) Points

co
eH w
Telephones cell = new Telephones(Cellular c);

o.
rs e
ou urc
Telephones(Cellular) cell = new Telephones(Cellular);

Telephones<> cell = new Telephones<>(Cellular c);


o
aC s
vi y re

Telephones cell = new Telephones(); (*)

None of the above.


ed d
ar stu

[Correct] Correct
is

4. The instanceof operator is a boolean comparison operator. True or false?


Mark for Review
Th

(1) Points

True (*)
sh

False

[Correct] Correct

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
5. An abstract class can be instantiated. Mark for Review
(1) Points

True

False (*)

[Incorrect] Incorrect. Refer to Section 2 Lesson 2.

6. Virtual method invocation requires that the superclass method is defined

m
er as
as which of the following? Mark for Review
(1) Points

co
eH w
A public static method.

o.
rs e
ou urc
A private final method.

A public method. (*)


o
aC s
vi y re

A public final method.

A default final method.


ed d
ar stu

[Correct] Correct
is

7. You can always upcast a subclass to an interface provided you don't


need to call any methods of the concrete class. True or false? Mark for Review
Th

(1) Points

True (*)
sh

False

[Incorrect] Incorrect. Refer to Section 2 Lesson 2.

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
8. Virtual method invocation is: Mark for Review
(1) Points

Not part of polymorphism.

When the method of a superclass is used on a superclass reference.

When the method of a subclass is used on a superclass reference. (*)

When the method of a subclass is used on a subclass reference.

[Correct] Correct

m
er as
co
9. Which one of the following would allow you to define the abstract class

eH w
Animal. Mark for Review
(1) Points

o.
rs e
ou urc
public abstract Animal

public abstract class Animal (*)


o
aC s
vi y re

public abstract Animal extends class

public Animal
ed d
ar stu

[Correct] Correct
is

10. The state of an object differentiates it from other objects of the same
class. Mark for Review
Th

(1) Points

True (*)
sh

False

[Correct] Correct

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
11. Which one of the following would allow you to define an interface for
Animal. Mark for Review
(1) Points

public interface Animal {} (*)

public class Animal implements Interface {}

public Animal extends Interface {}

public class Animal {}

m
er as
co
eH w
[Correct] Correct

o.
12.
rs e
A method with default access can be subclassed.
ou urc
True or false? Mark for Review
(1) Points
o

True
aC s
vi y re

False (*)
ed d

[Incorrect] Incorrect. Refer to Section 2 Lesson 1.


ar stu

13. Immutable classes can be subclassed.


True or false? Mark for Review
is

(1) Points
Th

True
sh

False (*)

[Correct] Correct

14. Making a class immutable means. Mark for Review

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
(1) Points

To create an instance of the class.

To create a sub class from a parent class

That it cannot be extended. (*)

That it is directly subclassed from the Object class

[Correct] Correct

m
er as
15. In general, classes can be made immutable by placing a final key word
before the class keyword.

co
True or false? Mark for Review

eH w
(1) Points

o.
True
rs e
ou urc
False (*)
o
aC s
vi y re

[Incorrect] Incorrect. Refer to Section 2 Lesson 1.


ed d
ar stu
is
Th
sh

This study source was downloaded by 100000756817934 from CourseHero.com on 04-16-2021 00:21:44 GMT -05:00

https://www.coursehero.com/file/13119097/JP-2/
Powered by TCPDF (www.tcpdf.org)

You might also like