由于此地板涉嫌违规,因此它将折叠在系统中以隐藏此地板并显示此地板
system.out.println(sotrue );
}
c ) int i=1;
int j=2;
if(I==1||j==2) {
system.out.println (确定);
}
d ) int i=1;
int j=2;
if(I==1|j==2) {
system.out.println (确定);
}
42、{Java主题}执行以下代码的结果为(c ) (选择1个项目) )
公共类文本{
publicstaticvoidmain (字符串[ ] args ) {
int x=1,y=6;
wile(y----==6) ) x----; }
system.out.println('x='x ',y=' y );
}
}
a )程序运行,输出结果: x=0,y=5 B )程序运行,输出结果: x=-1,y=4
c )程序可以运行,输出结果: x=0,y=4 D )程序不能编译
43、{Java主题}编译并执行以下Java代码后,输出结果中将显示以下选项中的(ACD )。
(选择三个项目() ) ) ) )。
公共类文本3 {
publicstaticvoidmain (string args [ ] ) {
for(intI=0; i3; I ) {
for(intj=3; j=0; j---- ) {
if(I==j ) ) )。
继续;
system.out.println (“I=”I“j=”j );
}
}
}
}
a ) i=0 j=3 B ) i=0 j=0 C ) i=0 j=2 D ) i=0 j=1
44、{Java主题}分析并编译执行以下Java代码,输出结果为(c )。 ((一项选择) ) ) ) ) )。
类a {
publicstaticvoidmain (字符串[ ] args ) {
method (;
}
静态语音方法
try{
system.out.println(「hello”);
}
法瑞{
system.out.println(「good-bye”)
}
}
}
a )无法编译“Hello” B )“good-bye” C” C )“hello”b”“good-bye”d )代码
45、{Java主题}以下程序的输出结果为。 (1项选择) a
公共类ex2 {
publicstaticvoidmain (字符串[ ] args ) )。
{
for(intCNT=0; cnt10; cnt )
{
if(CNT==5) ) )
布雷克;
系统. out.print (CNT;
}
}
}
a )0 1 2 3 4 B )6 7 8 9 C )0 1 2 3 4 6 7 8 9 D ) 5
46、{Java主题}给出以下代码片段: d
公共类Ex1 {
公共语音测试(
try {
method (;
}
catch (arrayindexoutofboundsexceptione ) {
system.out.println(exception1);
}
catch(exceptione ) {
system.out.println(exception2);
}
法瑞{
system.out.println('Thankyou!' );
}
}
公共语音方法
//.
}
publicstaticvoidmain (字符串[ ] args ) {
ex1 obj=new ex1 (;
obj.Test (;
}
}如果函数method正常运行并返回,会显示以下什么信息? (选择一个项目() ) ) )
a ) Hello World B ) Exception1 C ) Exception2 D ) Thank you!