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

能将程序补充完整的选项是class Person{ private int a; public int change(int m){return m;}}p

能将程序补充完整的选项是 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; _____ } }

A.i=m

B.i=b

C.i=p.a

D.i=p.change(50)

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
查看官方参考答案
更多“能将程序补充完整的选项是class Person{ private int a; public int change(int m){return m;}}p”相关的问题
第1题
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”.

点击查看答案
第2题
在//point x处的声在句法上合法的是______。

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 Persor();

Teacher t=new Teacher();

int i;

//point x

}

}

A.i=m;  B.i=b;

C.i=p.a;  D.i=p.change(30);

E.i=t.b;

点击查看答案
第3题
Which are syntactically valid statement at//point x?

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

}

}

A.i=m;            B.i=b;

C.i = p.a;             D.i = p.change(30);

E.i = t.b;

点击查看答案
第4题
请说出该程序段的功能。

declare @e numeric(5,2)

declare @ c1 int, @ c2 int, @ c3 int, @ c4 int

set @ c1=0; set @ c2 =0; set @ c3=0; set @ c4=0

declare xxx cursor

for select 成绩 from score

open xxx

fetch xxx into @ c

while @'@ fetch_status = 0

begin

if(@c > =90) set @cl =@ e1 +1;

else if(@ c > =70) set @ c2 =@ c2 +1;

else if(@ c> =60) set @ c3 =@ c3 +1;

else set @ c4 = @ c4 + 1

fetch from xxx into @ c

end

close xxx

deallocate xxx

print 优秀生人数:'+sb(@ c1,5);

print食好生人数:'+str(@ c2,5);

print及格生人数:'+str(@ c3,5);

print及格生人数:'+sh(@ c4,5)

点击查看答案
第5题
【简答题】What was their dream? __________________.
点击查看答案
第6题
下述代码的执行结果是 class Super { public int getLength() { return 4; } } public class Child extends Super { public long getLength() { return 5; } public static void main(String[] args) { Super sooper = new Super(); Super sub = new Child(); System.out.print(sooper.getLength() + "," + sub.getLength()); } }

A、2

B、4

C、编译失败

D、6

点击查看答案
第7题
下列关于interface的说法正确的是:

A、interface中可以有private方法

B、interface中可以有final方法

C、interface中可以有function实现

D、interface可以继承其他interface

点击查看答案
第8题
类 Teacher 和 Student 是类 Person 的子类; Teacher t; Student s; // t and s are all non-null. if (t instanceof Person ){ s=(Student)t; } 最后一条语句的结果是:

A、将构造一个Student 对象;

B、表达式是合法的;

C、表达式是错误的;

D、编译时正确, 但运行时错误。

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

1. 搜题次数扣减规则:

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

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

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

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

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

订单号:

遇到问题请联系在线客服

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

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

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

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

简答题官方微信公众号

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