PRO192_-_SP_2024_-_FE_1629.webp
N

PRO192_-_SP_2024_-_FE_1629.webp

Answer (Choose 1 answer)
Consider the following code:
1. Cat c 2. Washer w
3. Swamp Thing st:
4
5. c = new Cat():
6. w = c:7. st = (Swamp Thing) w.
Which of the following statements is true?
Where:
Mammal extends Animal Cat. Swamp Thing extends Mammal Cat implements Washer
A. The code will compile but will throw an exception at line 7, because the runtime class of w cannot be converted to type Swamp Thing.
B. Line 7 will not compile, because you cannot cast an interface to a class.
C. Line 6 will not compile; an explicit cast is required to convert a Cat to a Washer.
Animal
Whasher w
Mammal
Raccoon (implementsWasher)

Exit 41
Swamp Thing
Dog
Cat (implementsWasher)
st

Thông tin

Category
PRO192
Thêm bởi
ngochoa871
Ngày thêm
Lượt xem
4,317
Lượt bình luận
15
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_SP_2024_-_FE_1629.webp
File size
75.6 KB
Dimensions
1926px x 906px

Share this media

Back
Bên trên Bottom