Q28.webp
Đ

Q28.webp

Kizspy Question: 28
(Choose 1 answer)
Consider a superclass "Shape" with a method "draw()" and a subclass "Circle" that overrides the "draw()"
method. If an object of the "Circle" class is declared using the superclass type and the "draw()" method is
invoked, what will happen?
A. The "draw()" method of the superclass will be executed.
B. The "draw()" method of the subclass will be executed.
C. A compilation error will occur.
D. The "draw()" method will execute based on the type of the reference variable.
E. Both the "draw()" methods of the superclass and subclass will be executed.
F. The result depends on whether the "draw()" method is static or instance.

Thông tin

Category
PRO192
Thêm bởi
Đức Thành1
Ngày thêm
Lượt xem
1,574
Lượt bình luận
6
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom