> 数学 >
在Java中,有两个类Student和Person.如果Student是Person的子类,则下列声明对象x的语句中错误的是( ).(选择一项)
a) Person x = new Student();
b) Person x = new Person();
c) Student x = new Person();
d) Student x = new Student();
人气:414 ℃ 时间:2020-02-02 15:08:18
解答
c拉,a是子类为父类实例化,
b是父类为自己实例
c父类不能为子类实例化
d 子类为自己实例化
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版