用友校园招聘笔试题

编程语言 · 历年真题改编 · 题号 41568
多选题编程语言难度 3真题改编 · 2023中大厂

题目

对于如下代码,描述正确的是( ) class Animal{ public void move(){ System.out.println("the animal is moving"); } } class Dog extends Animal{ public void move(){ System.out.println("the dog can run"); } public void bark(){ System.out.println("the dog can bark"); } } public class TestDog{ public static void main(String args[]){ Animal a = new Animal(); Animal b = new Dog(); } }

选项4 个

Aa 对象可以调用move方法,输出为:the dog can run
Ba 对象可以调用move方法,输出为:the animal is moving
Cb对象可以调用bark方法输出为:the dog can bark
Db 对象不能调用bark方法。
🔒 答案与解析:登录后可查看本题答案、解析与考点讲解,并可在线作答自动判分 登录 / 注册
‹ 上一题 返回公务员考试·行测真题 下一题 ›

同类型题目编程语言 · 继续练习

题目免费浏览 · 整套练习与模拟考登录后开始 · 答案与解析登录后可见