题目内容 (请给出正确答案)
[单选题]

【单选题】7.7若有下面的程序代码 public class Test{ long a[]=new long[10]; public static void main(String args[]){ System.out.println(a[6]); } } 哪一个选项是正确的()。

A.不输出任何内容

B.输出0

C.当编译时有错误出现

D.当运行时有错误出现

提问人:网友walkrat 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有4位网友选择 A,占比40%
  • · 有3位网友选择 C,占比30%
  • · 有2位网友选择 B,占比20%
  • · 有1位网友选择 D,占比10%
匿名网友 选择了C
[6.***.***.239] 1天前
匿名网友 选择了A
[244.***.***.236] 1天前
匿名网友 选择了A
[209.***.***.185] 1天前
匿名网友 选择了D
[140.***.***.100] 1天前
匿名网友 选择了B
[29.***.***.168] 1天前
匿名网友 选择了A
[122.***.***.227] 1天前
匿名网友 选择了B
[26.***.***.152] 1天前
匿名网友 选择了A
[20.***.***.220] 1天前
匿名网友 选择了C
[24.***.***.142] 1天前
匿名网友 选择了C
[178.***.***.216] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“【单选题】7.7若有下面的程序代码 public class…”相关的问题
第1题
已知: class C { public static void main(String[] args) { print(); } public static void print() { static int i; System.out.println(++i); } }

A、0

B、1

C、编译错误

D、运行错误

点击查看答案
第2题
已知如下代码:public class Test{ public static void main ( String arg[] ) { long a[] = new long[6]; System.out.println ( a[6] ); } } 请问下列说法正确的是( )

A、程序输出 null

B、程序输出 0

C、程序被编译,但在运行时将抛出一个ArrayIndexOutOfBoundsException异常

D、因为long[]数组声明不正确,程序不能被编译

点击查看答案
第3题
The _______ FET amplifier has low input impedance, high output impedance, and high voltage gain.

A、common-gate

B、common-drain

C、common-source

D、None of the above

点击查看答案
第4题
给出下面的类:

public class Sample{

long length;

public Sample(long 1){length=1;}

public static void main(String arg[]){

Sample s1,s2,s3;

s1=new Sample(21L);

s2=new Sample(21L);

s3=s2;

long m=21L;

}

}

下面表达式返回true的是______。

A.s1==s2;  B.s2==s3;

C.m==s1;D.s1.equals(m);

点击查看答案
第5题
下列程序的输出结果为: class generalFunction{ public static int add(int x,int y){ return x+y; } //静态方法 } public class StaticFunTest{ public static void main(String[] args){ int c=generalFunction.add(7, 8); System.out.print("7 + 8 = " + c+ “, “); generalFunction fun=new generalFunction(); int d= fun.add(5, 8); System.out.println("5 + 8 = " + d); } }
点击查看答案
第6题
8、下列异常声明中,正确的是( )

A、A.public void throws IOException fun(){}

B、B.public void fun throws IOException(){}

C、C.public void fun()throws IOException{}

D、D.public void fun()throws IOException,throws SQLException{}

点击查看答案
第7题
测试如下代码: public class Ref{ public static void main(String[] args) { StringBuffer sbl = new StringBuffer("Hello"); StringBuffer sb2 = new StringBuffer("Hello"); boolean result = sbl.equals(sb2); System.out.println(result); } } 下述哪条语句正确描述了程序编译和运行的行为?

A、编译成功,输出为 true

B、编译成功,输出为 1

C、编译成功,输出为 false

D、编译成功,输出为 0

点击查看答案
第8题
下列程序中:

class AClass{

private long val;

public AClass(long v){val=v;}

public Static void main(String args[]){

AClass x=new AClass(10L);

AClass y=new AClass(10L);

AClass z=y;

long a=10L;

int b=10;

}

}

表达式正确的是______。

A.a==b;  B.a==x;  C.y==z;

D.X==y;  E.a==10.0;

点击查看答案
第9题

阅读下面求质数的程序 import java.lang.Math.*: public class MorePrimesTest { public static void main(String[] args) { long[] primes=new long[20]; primes[0]=2L; primes[0]=3L; long number=5L; outer: for(int count=2;count<primes.length;number+=2L) { long limit=(long)Math.ceil(Math.sqrt((double)number)); for(int i=1;i<count&&primes[i]<=limit;i++) { if(number primes[i]==OL)continue outer; } primes[count++]=number; } for(int J=0;j<primes.length;j++) { long n=primes[j]; System.out.println(n); } } } 程序下画线处应填入的正确选项是

A.&

B.*

C./

D.%

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

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

简答题官方微信公众号

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

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

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