题目内容 (请给出正确答案)
[主观题]

设有类定义如下:class InOut{String s= new String("Between");public void ametho

设有类定义如下:

class InOut{

String s= new String("Between");

public void amethod(final int iArgs){

int iam;

class Bicycle{

public void sayHello(){

//Here

}

}

}

public void another(){

int iOther;

}

}

以下哪些语句可以安排在//Here处 ?

A. System.out.println(s);

B.System.out.println(iOther);

C. System.out.println(iam);

D. System.out.println(iArgs);

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“设有类定义如下:class InOut{String s= …”相关的问题

第1题

设有如下代码:interface IFace{}class CFace implements IFace{}class Base{}public class Ob

设有如下代码:

interface IFace{}

class CFace implements IFace{}

class Base{}

public class ObRef extends Base{

public static void main(String argv[]){

ObRef bj = new ObRef();

Base b = new Base();

Object obj1 = new Object();

IFace obj2 = new CFace();

//Here

}

}

则在 //Here处插入哪个代码将不出现编译和运行错误。

A.obj1=obj2;

B.b=obj;

C.obj=b;

D.obj1=b;

点击查看答案

第2题

设有如下变量说明:byte myByte;int myInt;long myLong;char myChar;float myFloat;double myDouble;以下赋值语句哪个需要强制转换。

A.myInt = myByte;

B.myInt = myLong;

C.myByte = 3;

D.myInt = myChar;

E.myFloat = myDouble;

F.myFloat = 3;

G.myDouble = 3.0;

点击查看答案

第3题

以下的程序的调试结果为?public class As{int i = 10;int j;char z= 1;boolean b;public static

以下的程序的调试结果为?

public class As{

int i = 10;

int j;

char z= 1;

boolean b;

public static void main(String argv[]){

As a = new As();

A.amethod();

}

public void amethod(){

System.out.println(j);

System.out.println(b);

}

}

A.输出0 和false

B. 输出0 和true

C. 编译错误,b 未初始化

D. 编译错误, z 必须赋字符值

点击查看答案

第4题

试完成下述程序片段:public class Point(){ int x,y;public Point(int x,int y){ =x; =y;}......}

A. Point.x Point.y

B.无解

C. x1 y1

D.this.x this.y

点击查看答案

第5题

以下程序的调试结果为?class Base{public final void amethod(){System.out.println("amethod");}}public class Fin extends Base{public static void main(String argv[]){Base b = new Base();b.amethod();}}

A.编译指示带有final 方法的类自己必须定义为final

B.编译指示不能继承含有final 方法的类

C.运行错误,原因是Base类没有定义为final类

D.运行输出 amethod

点击查看答案

第6题

下列哪个方法不属于播放声音的方法?

A. loop()

B. stop()

C. start()

D. play()

点击查看答案

第7题

下列程序运行的结果为:public class Example{String str=new String("good");char[]

下列程序运行的结果为:

public class Example{

String str=new String("good");

char[] ch={'a','b','c'};

public static void main(String args[]){

Example ex=new Example();

ex.change(ex.str,ex.ch);

System.out.print(ex.str+" and ");

Sytem.out.print(ex.ch);

}

public void change(String str,char ch[]){

str="test ok";

ch[0]='g';

}

}

A. good and abc

B. good and gbc

C. test ok and abc

D. test ok and gbc

点击查看答案

第8题

以下的程序的调试结果为public class Scope{int i;public static void main(String argv[]){Scope s = new Scope();s.amethod();}public static void amethod(){System.out.println(i);}}

A. 输出结果为:0

B. 无输出

C. 编译错误

D. 输出null

点击查看答案

第9题

下列说法错误的一项是?

A.getDocumentBase()用于获取包含Applet的HTML文件的URL

B.getCodeBase()用于获取Applet主类的URL

C.getParameter(String name)用于获取标记中的参数值

D.若指定参数在HTML中没有说明,则Applet将停止运行。

点击查看答案

第10题

考虑如下类:1. class Test(int i) {2. void test(int i) {3. System.out.println("I am an

考虑如下类:

1. class Test(int i) {

2. void test(int i) {

3. System.out.println("I am an int.");

4. }

5. void test(String s) {

6. System.out.println("I am a string.");

7. }

8.

9. public static void main(String args[]) {

10. Test t=new Test();

11. char ch="y";

12. t.test(ch);

13. }

14. }

以下哪条为真?

A.行 5 不能通过编译,方法不能被覆盖.

B.行 12 不能通过编译, 因为没有一个test()方法含字符参数.

C.代码可以编译但在12行将出现异常.

D.代码可以编译且产生如下输出: I am an int.

E.代码可以编译且产生如下输出: I am a String.

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

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

警告:系统检测到您的账号存在安全风险

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

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信