PRO192_-_FA_2024_-_Block_5_-_FE_3237.webp
plum_blossom1

PRO192_-_FA_2024_-_Block_5_-_FE_3237.webp

Kizspy | Question: 29
(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
FUOV

Thông tin

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

Share this media

Back
Bên trên Bottom