重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
找答案首页 > 全部分类 > 求职面试
搜题
网友您好, 请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
[主观题]

public class A { public void draw(){System.out.println(“NO?”)}};} class B extends A { publ

public class A { public void draw(){System.out.println(“NO?”)}};} class B extends A { public void draw(){ System.out.println(“YES!”)};} A a=new B(); a.draw(); 输出结果是__________,最后两条语句程序体现了java的__________性质。

暂无答案
更多“public class A { public void draw(){System.out.println(“NO?”)}};} class B extends A { publ”相关的问题

第1题

下列程序的输出结果是 ( ) class Derao { void test() { Systeme.out.print("NO");} void test (int i) {System.out.print(a);} void test(int a,int b) {System.out.print(a+b);} } class Test { public static void main(String args[]) { Demo de=new Demo(); de.test(); de.test5.; de.test(6,8); } }

A.No568

B.568No

C.No514

D.86No5

点击查看答案

第2题

11.classCup{}12.classPoisonCupextendsCup{}21.publicvoidtakeCup(Cupc){22.if(cinstanceofPoisonCup){23.System.out.println(”Inconceivable!”);24.}elseif(cinstanceofCup){25.System.out.println(”Dizzyingintellect!”);26.}else{27.System.exit(0);28.}29.}Andtheexecutionofthestatements:Cupcup=newPoisonCup();takeCup(cup);Whatistheoutput?()

A.Inconceivable!

B.Dizzyingintellect!

C.Thecoderunswithnooutput.

D.Anexceptionisthrownatruntime.

E.Compilationfailsbecauseofanerrorinline22.

点击查看答案

第3题

阅读以下程序说明和java代码,将应填入(n)处的字句写在对应栏内。

[说明]

本程序接收输入的学生信息,包括学号、姓名、成绩,原样输出信息并计算学生的平均成绩。其中学生类Stud除了包括no(学号)、name(姓名)和grade(成绩)数据成员外,还有两个静态变量 sum和num,分别存放总分和人数,另有一个构造函数、一个普通成员函数disp()和一个静态成员函数avg()用于计算平均分。

[Java代码]

public class Stud {

public int no;

public String name;

public double grade;

public (1) double sum=0;

public static int num=0;

public Stud(int no,String name,double grade) {

this.no = no;

this.name = name;

this.grade = grade;

this.sum=(2);

(3);

}

public static double avg(){

return (4);

}

public void disp(){

System.out.println(this.no+"\t"+this.name+"\t"+this.grade);

}

public static void main(String[] args) {

Stud []students = {new Stud (1,"Li", 81), new Stud(2,"Zhao",84.5), new Stud(3,"Zhang", 87)};

System.out.pfintln("no\tname\tgrade");

students[0].disp();

students[1].disp();

students[2].disp();

System.out.println("avg="+(5));

}

}

点击查看答案

第4题

下面程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是 public class FindKeyWords{ public static void main(String[]args) { String text="An array is a data structur that stores a collection of" +"values of the same type. You access each indMdual value" +"through an integer index. For example,if a is an array" +"of inergers,then a[i]is the ith integer in the array."; int arrayCount=0; int index=-1; String arrayStr="array"; index=text.indexOf(arrayStr); while(index>=0) { ++arrayCount; index+=arrayStr.length(); index=text.indexOf(arrayStr,index); } System.out.println("the text contains"+arrayCount+"arrays"); } }

A.<

B. =

C.<=

D.>=

点击查看答案

第5题

下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是( )。 public class FindKeyWords( public static void main(sring[]args){ sting text= "An array is a data structur that stores a eollection of" +"values of the same type.You access each individu- al value" +"through an integer index.For example.if a is an array" +"of inergers,then all]is the ith integer in the ar- ray."; Int arrayCount=0; Int idex=-l; Sting arrarStr="array": Index=text.indexof(arrayStr); While(index 0){ ++arrayCount: Index+=arrayStr.1ength; Index=text.indexof(arrayStr,index); } System.OUt.println ("the text contains"+arrayCount+"arrays"); } }

A.<

B.=

C.<=

D.>=

点击查看答案

第6题

下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是( )。 public class FindKeyWords( public static void main(sring[]args){ sting text= "An array is a data structur that stores a eollection of" +"values of the same type.You access each individu- al value" +"through an integer index.For example.if a is an array" +"of inergers,then all]is the ith integer in the ar- ray."; Int arrayCount=0; Int idex=-l; Sting arrarStr="array": Index=text.indexof(arrayStr); While(index 0){ ++arrayCount: Index+=arrayStr.1ength; Index=text.indexof(arrayStr,index); } System.OUt.println ("the text contains"+arrayCount+"arrays"); } }

A.<

B.=

C.<=

D.>=

点击查看答案

第7题

下面的程序是打印输出100~300之间的不能被3整除的数。请在每条横线处填写一条语句,使程序的功能完整。

注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填人适当的语句。

public class printNo3and5{

void print()

{

int n ;

for(n=100 ;n<=300 ;n++){

if(n%3==0)

__________

System.out.println(n);

}

}

public static__________main(String args[])

{

printNo3and5 bj=new printN03and5();

__________

}

}

点击查看答案

第8题

下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是( )。 publicclassFindKeyWords{ publicstaticvoidmain(sring[]args){ stingtext= “Anarrayisadatastructurthatstoresacollectionof” +“valuesofthesametype.YOUaccesseachindividualvalue'’ +“throughanintegerindex.Forexample,ifaiSanarray” +“of inergers,thena[i]iSthe ith integer in thearray.”; In tarrayCount=0; Intidex=-1; Sting arrarStr=“array”; IndeX=text.indexof(arrayStr); While(index______0){ ++arrayCount; Index+=arrayStr.length(); IndeX=text.indexof(arrayStr,indeX); } SyStem.out.phntln (“thetextcontains”+arrayCount+“arrays”); } }

A.<

B.=

C.<=

D.>=

点击查看答案

第9题

下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是( )。 publicclassFindKeyWords{ publicstaticvoidmain(sring[]args){ stingtext= “Anarrayisadatastructurthatstoresacollectionof” +“valuesofthesametype.YOUaccesseachindividualvalue'’ +“throughanintegerindex.Forexample,ifaiSanarray” +“of inergers,thena[i]iSthe ith integer in thearray.”; In tarrayCount=0; Intidex=-1; Sting arrarStr=“array”; IndeX=text.indexof(arrayStr); While(index______0){ ++arrayCount; Index+=arrayStr.length(); IndeX=text.indexof(arrayStr,indeX); } SyStem.out.phntln (“thetextcontains”+arrayCount+“arrays”); } }

A.<

B.=

C.<=

D.>=

点击查看答案

第10题

intx=3;inty=1;if(x=y){System.out.println(x=+x);}Whatistheresult?()

A.x=1

B.x=3

C.Compilation&ensp;fails.

D.The&ensp;code&ensp;runs&ensp;with&ensp;no&ensp;output.&ensp;

E.An&ensp;exception&ensp;is&ensp;thrown&ensp;at&ensp;runtime.

点击查看答案
下载上学吧APP
客服
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
选择优惠券
优惠券
请选择
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

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

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

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

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

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

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

- 微信扫码关注上学吧 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注上学吧 -
请用微信扫码测试
选择优惠券
确认选择
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,如果您知道正确答案,欢迎您来纠错

上学吧找答案