题目详情
单选题 根据下列程序代码,选择项描述正确的是() 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"); } }

学科:面向对象程序设计(Java)
时间:2024-03-31 10:47:34
