题海让大学四年没有难题
白天模式登陆

题目详情

单选题 下面程序运行的结果是( )public class A { public static void main(String[] args) { B b = new B(); b.test(); } void test() { System.out.print("A"); }}class B extends A { void test() { super.test(); System.out.print("B"); }}

A. 产生编译错误

B. 代码可以编译运行,并输出结果AB

C. 代码可以编译运行,但没有输出

D. 编译没有错误,但会产生运行时异常

Java程序设计课程封面

学科:Java程序设计

时间:2024-06-17 10:08:53

Copyright © 2022 津ICP备2021001502号