PRO192_-_FA_2022_-_FE_232.webp
hirosi212

PRO192_-_FA_2022_-_FE_232.webp

Multiple choices 34/50
(Choose 1 answer)
Consider the following code:
1. Cat c
4 5. c = new Cat():
Next
2. Washer w.
3. Swamp Thing st
6. w = c:
7. st = (Swamp Thing) w,
Which of the following statements is true?
Where:
Mammal extends Animal
Cat, SwampThing extends Mammal Cat implements Washer
A. Line 6 will not compile; an explicit cast is required to convert a Cat to a Washer.
B. The code will compile but will throw an exception at line 7.
Animal
Mammal
Whasher w
st
Dog
Cat (implementsWasher)
Raccoon (implementsWasher)
Swamp Thing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 26
27
28
29 30
31
32
33
34
35
36 37 38 39 40 41
42
43 44 45 46
47 48
49
50

Thông tin

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

Share this media

Back
Bên trên Bottom