搜题
网友您好,请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
提问人:网友sangjiabei 发布时间:2022-01-07
[主观题]

对于下例代码,下面叙述正确的是()。 class Person { Person(int m){ } } class Student extends Person { }

A、可以用Person类的无参数构造方法创建对象:new Person()。

B、可以用Student类的无参数构造方法创建对象:new Student()。

C、代码无法通过编译。

D、Person类不能创建对象。

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
查看官方参考答案
更多“对于下例代码,下面叙述正确的是()。 class Person { Person(int m){ } } class Student extends Person { }”相关的问题
第1题
下列语句输出的结果是________。 class Person: def getInfo(self): return "Person" def printPerson(self): print(self.getInfo()) class Student(Person): def getInfo(self): return "Student" Person().printPerson() Student().printPerson()

A、Person Student

B、Person Person

C、Student Student

D、Student Person

点击查看答案
第2题
For a company concentrating on final assembly, adding retail and distribution into it's value chain will require:

A、backward integration.

B、forward integration.

C、taper integration.

D、related diversification.

E、unrelated diversification.

点击查看答案
第3题
对于下列代码,叙述正确的是( )。 interface Com{ int MAX=100; public void stop(); protected void start(); abstract void pause(); }

A、int MAX=100; 会导致编译出错。

B、public void stop(); 会导致编译出错。

C、protected void start(); 会导致编译出错。

D、abstract void pause(); 会导致编译出错。

点击查看答案
第4题
下面程序的运行结果是( )。class Animal{ public Animal(){ System.out.println("I'm an animal."); } } class Bird extends Animal{ public Bird(){ System.out.println("I'm a bird."); } } public class AnimalTest{ public static void main(String[] args) { Bird b = new Bird(); } }

A、编译错误

B、无输出结果

C、I'm a bird.

D、I'm an animal. I'm a bird.

点击查看答案
第5题
class Person { private int a; public int change(int m){ return m; } } public class Teacher extends Person { public int b; public static void main(String arg[]){ Person p = new Person(); Teacher t = new Teacher(); int i; // point x } } Which are syntactically valid statement at // point x?

A、i = m;

B、i = b;

C、i = p.a;

D、i = p.change(30);

点击查看答案
第6题
class Computation extends Thread {

private int num;

private boolean isComplete;

private int result;

public Computation(int num) { this.num = num; }

public synchronized void run() {

result = num * 2;

isComplete = true;

notify();

}

public synchronized int getResult() {

while (!isComplete) {

try {

wait();

} catch (InterruptedException e) { }

}

return result;

}

public static void main(String[] args) {

Computation[] computations = new Computation [4];

for (int i = 0; i< computations.length; i++) {  computations[i] = new Computation(i);  computations[i] .start();  }  for (Computation c : computations)  System.out.print(c.getResult() +“ “);  }  }  What is the result?()

A.  The code will deadlock.

B.  The code may run with no output.

C.  An exception is thrown at runtime.

D.  The code may run with output “0 6”.

E.  The code may run with output “2 0 6 4‟.

F .  The code may ruin with output “0 2 4 6”.

点击查看答案
第7题
【单选题】在下列C# 代码中,( )是类Teacher 的属性。 public class Teacher{ int age=13; public string Name{ get{return name;} set{name=value;} } public void SaySomething(){//…} }

A、Name

B、name

C、age

D、SaySomething

点击查看答案
第8题
设有以下定义: #include<iostream.h> class A1 { public: void show1() { cout<<"class }; a2:public a1 { public: void a3:protected a2 main() obj1; obj2; a3 obj3; } 以下不合法的调用语句是(> A、obj1.show1();

B、obj2.show1();

C、obj3.show1();

D、obj2.show2();

点击查看答案
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注简答题 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注简答题 -
请用微信扫码测试
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

简答题
下载APP
关注公众号
TOP