Consider the following Java program. What is the output of the program? class A { int x = 10; } class B extends A { int x = 20; public static void main(String[] args) { A obj = new B(); System.out.print(obj.x); } }单项选择题

A
A. Compilation error
B
B. 10
C
C. Runtime error
D
D. 20
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
Consider the following Java program. What is the output of the program?
Consider the following Java program. What is the output of the program?
Is the following statement true or false? In the products of methylation-hydrolysis, every -OH group corresponds to the position of a glycosidic bond in the starting polysaccharide.
Which of the follwoing structures represents amylopectin?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!