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

● 下面是一段 javabean 程序,该程序的运行结果是 (62) 。 public class NullTest { public static

● 下面是一段 javabean 程序,该程序的运行结果是 (62) 。

public class NullTest

{

public static void main(String[] args)

{

int M = 0;

String str = null;

StringBuffer sb = new StringBuffer(“= “);

sb.append(str);

sb.append(M++);

System.out.println(sb.toString());

}

}

(62)

A.=null

B.=null0

C.=null1

D.=nullM

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
查看官方参考答案
更多“● 下面是一段 javabean 程序,该程序的运行结果是 (62) 。 public class NullTest { public static”相关的问题
第1题
以下程序运行结果是 public class HasStatic { private static int x=100; public static void main(String args[ ]){ HasStatic hs1=new HasStatic( ); hs1.x++; HasStatic hs2=new HasStatic( ); hs2.x++; hs1=new HasStatic( ); hs1.x++; HasStatic.x--; System.out.println("x="+x); } }

A、x=103

B、x=102

C、x=101

D、编译错误

点击查看答案
第2题

执行后的输出是 public class Test { public static void main(String [] args){ System.out.println(new B().getValue()); } static class A{ protected int value; public A(int v) { setValue(v); } public void setValue(int value){ this.value = value; } public int getValue(){ try{ value++; return value; } catch(Exception e){ System.out.println(e.toString()); } finally { this.setValue(value); System.out.println(value); } return value; } } static class B extends A{ public B() { super(5); setValue(getValue() - 3); } public void setValue(int value){ super.setValue(2 * value); } } }

A、11 17 34

B、22 74 74

C、6 7 7

D、22 34 17

点击查看答案
第3题
下面代码段, 哪行将引起一个编译时错误 public class Test23 { int n = 0; int m = 0; public Test23(int a) { m=a; } public static void main(String arg[]) { Test23 t1,t2; int j,k; j=3;k=5; t1=new Test23(); t2=new Test23(k); } }

A、public Test(int a) { m=a; }

B、j=3;k=5;

C、t1=new Test23();

D、t2=new Test23(k);

点击查看答案
第4题
以下程序运行结果是 class Super { public int getLength() { return 4; } } public class Sub extends Super { public long getLength() { return 5; } public static void main (String[]args) { Super sooper = new Super (); Super sub = new Sub(); System.out.println(sooper.getLength()+ "," + sub.getLength()); } }

A、5, 4

B、4, 4

C、5, 5

D、4, 5

点击查看答案
第5题
下列类的定义,正确的是

A、final class operators{……}

B、void class Point{……}

C、public class test extends Object{……}

D、class Point{……}

点击查看答案
第6题
现有: 1 Interface F{} 2 class A implements F{} 3 class B extends A{} 4 class C extends B{ 5 public static void main(String[] args){ 6 B b=new B(); 7 //inSert C0de here 8 } 9 } 下列哪行代码插入到第7行,将抛出java.lang.ClassCaseException异常

A、A a=b;

B、F f= (C)b;

C、F f= (A)b;

D、B bb= (B)(A)b;

点击查看答案
第7题
现有: 1. interface Animal f 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat implements Feline { 8. public void eat() { } 9. } 和以下三个接口声明: interface Feline extends Animal ( ) interface Feline extends Animal {void eat(); } interface Feline extends Animal {void eat() { } } 分别插入到第5行,有多少行可以编译?

A、0

B、1

C、2

D、3

点击查看答案
第8题
下列关于接口的定义哪项是正确的

A、interface C{int a;}

B、public interface A implements B {}

C、public interface A {int a(); }

D、abstract interface D {}

点击查看答案
第9题
现有: 1. abstract class Color { 2.protected abstract String getRGB(); 3. } 4. 5. public class Blue extends Color { 6. //insert code here 7. } 和四个声明: public String getRGB() { return "blue"; } String getRGB() { return "blue"; ) private String getRGB() { return "blue"; } protected String getRGB() { return "blue"; ) 分别插入到第6行,有几个可以通过编译?

A、0

B、1

C、2

D、3

点击查看答案
第10题
现有: 1. interface Color { } 2. interface Weight { } 3. //insert code here 和以下六个声明: class Boat extends Color, extends Weight { } class Boat extends Color and Weight { } class Boat extends Color, Weight { } class Boat implements Color, implements Weight { } class Boat implements Color and Weight { } class Boat implements Color, Weight { } 分别插入到第3行,有多少行可以编译?

A、0

B、1

C、2

D、3

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

1. 搜题次数扣减规则:

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

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

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

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

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

订单号:

遇到问题请联系在线客服

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

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

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

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

简答题官方微信公众号

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