PRO192_-_SU_2024_-_FE2_2332.webp
Nanami871

PRO192_-_SU_2024_-_FE2_2332.webp

Kizspy | Question: 25 (Choose 1 answer)
What is the output of the following Java program?
class Demo { void m1(String x) { System.out.println("One");}
}
class DemoChild extends Demo { public void m2(String x) { System.out.println("Two");super.m1(x);}
} public class Test {
public static void main(String[] args) { Demo obj = new DemoChild();obj.m2("PE");}
}
A. Compile error
B. Runtime error
C. Output is: Two One
D. Output is: One Two

Thông tin

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

Share this media

Back
Bên trên Bottom