PRO192_-_SU_2024_-_FE2_2332.webp
Nanami871

PRO192_-_SU_2024_-_FE2_2332.webp

Kizspy | Question: 27
(Choose 1 answer)
What is the output of the following Java program?
class Test {
void m1(String x) { System.out.println("Parent");}
}
class TestChild extends Test {
public void m2(String x) {
System.out.println("Child");super.m1(x);
}
} public class Main {
public static void main(String[] args) {
Test obj = new TestChild();
if (obj instanceof TestChild) {
obj.m2("FE");
}
A. Compile error
B. Child
Parent
C. Child Child
D. Parent Parent

Thông tin

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

Share this media

Back
Bên trên Bottom