题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-14 12:34:49

[简答题]阅读下列程序,写出程序运行结果。
public class C3302

public static void main(String[] args)

int[][]a=1,2,3,4,5,6;
System.out.println(a.length+","+a[0].length+","+a[1][1]);
f3302(s[0],s[1]);
System. out. println(s[0]+","+s[1]);
String s1="abc",s2="123";
s1+="xyz";
s2. concat("xyz");
System. out. println(s1+","+s2);

static void f3302(String x,String y)

String z=x;x=y;y=z;


更多"阅读下列程序,写出程序运行结果。 public class C330"的相关试题:

[简答题]阅读下列程序,请写出程序的运行结果。
public class C

public static void main(String[] args)

String text="public static void main(String[] args)";
int theCount=0;
int index=-1;
String theStr="i";
index=text. indexOf(theStr);
while(index>=0)

++theCount;
index+=theStr. length( );
index=text. indexOf(theStr,index);

System. out. println("The Text contains"+theCount+"i");


[简答题]阅读下列程序,写出程序运行结果。
class A1

public void f(int aa,int bb)

System.out.println(aa+bb);


class A2 extends A1

public void f(int aa,int bb)

System. out. println(aa-bb);


public class C3201 extends A2

public void f(int aa,int bb)

System. out. println(aa*bb);

public static void main(String[] args)

A1 a=new Al( );
A1 a1=new A2( );
A2 a2=new C3201( );
a.f(20,10);
a1.f(20,10);
a2.f(20,10);


[填空题]

请写出下面程序的运行结果:
public class Test extends TT{
public static void main(String args[]){
Test t=new Test("Tom.");
}
public Test(String s){
super(s);
System.out.print("How are you");
}
public Test( ){
this("I am Jack.");
}
}
class TT{
public TT( ){
System.out.print("Hi!");
}
public TT(String s){
this( );
System.out.print("I am"+s);
}
}
结果:()。


[简答题]阅读以下程序代码,写出程序的输出结果。
public class Class35

public static void main(String[] args)

String s1=new String("0860371"),s2="0860371";
System. out. println(s1==s2);
System. out. println(s1. equals(s2));
System. out. println(s1. endsWith(s2)==s1. startsWith(s2));


[简答题]阅读以下程序代码,写出程序的输出结果。
public class Class32

public static void main(String[] args)

boolean x=true,y=false,z=false;
x=x&&y||z;
y=x||y&&z;
z=!(x!=y)||(y==z);
System. out. println(x+","+y+","+z);


[简答题]阅读以下程序代码,写出程序的输出结果。
public class Class33

public static void main(String[] args)

int a,b,c;
a=b=c=1;
boolean w;
w=a++>1&&++b>c++:
System. out. println(a+","+b+","+c+","+w);


[填空题]请写出下面程序的运行结果: public class Test extends TT{ public static void main(String args[])( Test t=new Test("Tom."); } public Test(SUing s){ super(s); System.out.print("How are you"); } public Test( ){ this("I am Jack."); } } class TT{ public TT( ) { System,out.print("Hi!"); } public TT(String s){ this( ); System.out.print("I am"+s); } } 结果: 【15】
[填空题]请写出下面程序的运行结果:
public class Test extends TT
public static void main(String args[])
Test t=new Test("Tom.");

public Test(String s)
super(S);
System.out.print("How are you");

public Test( )
this("I am Jack.");


class TT
public TT( )
System.out.print("Hi!");

public TT(String s)
this( );
System.out.print("I am" +s);


结果:______。
[填空题]请写出下面程序的运行结果: public class Test extends TT{ public static void main(String args[]){ Test t=new Test("Tom."); } public Test(String s){ super(s); System.out.print("How are you"); } public Test( ){ this("I am Jack."); } } class TT{ public TT( ){ System.out.print("Hi!"); } public TT(String s){ this( ); System.out.print("I am"+s); } } 结果【 】。
[填空题]请写出下面程序的运行结果: public class Test extends TT{ public static void main(String args[]){ Test t=new Test("Tom."); } public Test(String s){ super(S); System.out.print("How are you"); } public Test( ){ this("I am Jack."); } } class TT{ public TT( ){ System.out.print("Hi!"); } public TT(String s){ this( ); System.out.print("I am" +s); } } 结果:______。
[简答题]阅读以下程序代码,写出程序的功能。
public class Class34

public static void main(String[] args)

int a=1,b;
while(a<=9)

b=1;
while(b<=a)

System. out. print(" "+a+"×"+b+"="+a*b);
b++;

System. out. println( );
a++;



[简答题]阅读下列程序,请写出该程序的输出结果。
public class C

int x=10;
static int y=20;
public static void main(String[] args)

C obj1=new C( );
C obj2=new C( );
obj1.x*=2;
obj1.y*=3;
obj2.x+=4;
obj2.y+=5;
System. out. println(obj1.x);
System. out. println(obj1.y);
System. out. println(obj2.x);
System. out. println(obj2.y);


我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码