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

题目详情

单选题 根据下列程序代码,选择项描述正确的是() Show the output of running the class Test in the following code lines: interface A { void print(); } class C {} class B extends C implements A { public void print() { } } class Test { public static void main(String[] args) { B b = new B(); if (b instanceof A) System.out.println("b is an instance of A"); if (b instanceof C) System.out.println("b is an instance of C"); } }

A. Nothing

B. b is an instance of A followed by b is an instance of C

C. b is an instance of A

D. b is an instance of C

面向对象程序设计(Java)课程封面

学科:面向对象程序设计(Java)

时间:2024-03-31 10:47:34

Copyright © 2022 津ICP备2021001502号