0% found this document useful (0 votes)
337 views4 pages

1

The document contains 10 multiple choice questions about Java concepts like immutability, interfaces, generics, and enums. Key points covered include that interfaces define method signatures without implementations, wildcards allow greater control over types in generics, and enums do not need to be declared in their own class.

Uploaded by

FcBebin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
337 views4 pages

1

The document contains 10 multiple choice questions about Java concepts like immutability, interfaces, generics, and enums. Key points covered include that interfaces define method signatures without implementations, wildcards allow greater control over types in generics, and enums do not need to be declared in their own class.

Uploaded by

FcBebin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Immutable
classes can Mark for Review
be (1) Points
subclassed.
True or
false?

True
False (*)

Correct

2. An interfaces can declare public constants.


True or False? Mark for Review
(1) Points

True (*)
False

Incorrect. Refer to Section 2 Lesson 1.

3. Interfaces define what?


Mark for Review
(1) Points

Variables and methods


All method definitions without any implementations (*)
Constants and all methods with implementations
All methods with implementations
Some methods with implementations

Correct

4. Which two statements are equivalent to line 2?


(Choose Two) 1. public interface Account{ Mark for Review
2. int accountID=100; (1) Points
3. }

(Choose all correct answers)

private int accountID=100;


Final int accountID=100; (*)
Abstract int accountID=100;
protected int accountID=100;
static int accountID=100; (*)

Correct
5. An interface can implement methods.
True or False? Mark for Review
(1) Points

True
False (*)

Incorrect. Refer to Section 2 Lesson 1.

6. Wildcards
in Mark for Review
generics (1) Points
allows us
greater
control
on the
types
that can
be used.
True or
False?

True (*)
False

Correct

7. < ? extends Animal > is an example of a bounded generic wildcard.


True or False? Mark for Review
(1) Points

True (*)
False

Correct

8. < ? > is an example of a bounded generic wildcard.


True or False? Mark for Review
(1) Points

True
False (*)

Correct

9. Which of the following would initialize a generic class "Cell" using a String
type? Mark for Review
I. Cell <String> cell = new Cell(); . (1) Points
II. Cell <String> cell = new Cell <String>(); .
III. Cell cell = new String;

I only
I and II (*)
II only
II and III
III only

Correct

10. Enumerations (enums) must be declared in their own class.


True or False? Mark for Review
(1) Points

True
False (*)

Correct
6. Wildcards
in Mark for Review
generics (1) Points
allows us
greater
control
on the
types
that can
be used.
True or
False?

True (*)
False

Correct

7. < ? extends Animal > is an example of a bounded generic wildcard.


True or False? Mark for Review
(1) Points

True (*)
False

Correct

8. < ? > is an example of a bounded generic wildcard.


True or False? Mark for Review
(1) Points

True
False (*)

Correct
9. Which of the following would initialize a generic class "Cell" using a String
type? Mark for Review
I. Cell <String> cell = new Cell(); . (1) Points
II. Cell <String> cell = new Cell <String>(); .
III. Cell cell = new String;

I only
I and II (*)
II only
II and III
III only

Correct

10. Enumerations (enums) must be declared in their own class.


True or False? Mark for Review
(1) Points

True
False (*)

Correct

You might also like