题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-20 02:42:57

[简答题]

阅读下列程序,请写出该程序的输出结果。
public class A {
int m = 5;
static int n = 3;
public static void main(String[] args) {
A obj 1 = new A( );
A obj2 = new A( );
objl.m *= 2;
objl.n *= 4;
obj2.m += 1;
obj2.n += 6;
System.out.println("obj 1.m=’’ + obj 1.m);
System.out.println("obj 1.n=" + obj 1.n);
System.out.println("obj2.m=" + obj2.m);
System.out.println("obj2.n=" + obj2.n);
}
}


更多"阅读下列程序,请写出该程序的输出结果。 public class 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);


[简答题]

阅读下列程序,请写出该程序的输出结果。
class Test33 {
static int merger(int [] a, int []b, int []c){
int i = 0, j = 0, k = 0;
while(i < a.length && j < b.length) {
if(a[i] < b[j])c[k++] = a[i++];
else c[k++] = b[j++];
}
while(i < a.length) c[k++] = a[i++];
while(j < b.length) c[k++] = b[j++];
return k;
}
public static void main(String[] args) {
int a[] = {3, 6, 9};
int b[] = { 1, 2, 5};
int []c = new int[100];
int p = merger(a, b, c);
for(int k = 0; k < p; k++)
System.out.print(c[k]+ (k < p-1 " ":"/n"));
}


[填空题]阅读以下程序,请写出输出结果_________   public class EqualsMethod{   public static void main (String[]args){   Integer nl=new Integer (47):   Integer n2=new Integer (47);   System.out.println(n1.equals(n2));   }
[填空题]阅读以下程序,请写出输出结果_________  public class EqualsMethod  public static void main (String[]args)  Integer nl=new Integer (47):  Integer n2=new Integer (47);  System.out.println(n1.equals(n2));  

[简答题]阅读下列程序,请写出程序的运行结果。
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");


[单项选择]下列程序的输出结果是
public class fff
void printValue (int m)
do System.out.println("The value is" +m);

while(--m>10)

public static void main (String arg[])
int i=10;
Test t= new Test( );
t. printValue(i);


A. 8
B. 9
C. 10
D. 11
[单项选择]下面程序段的输出结果为 public class Test { int a, b; Test( ) { a=100; b=200; } Test(int x,int y) { a=x; b=y; } public static void main(String args[]) { Test Obj1=new Test(12,45); System.out.println("a=+Obj1.a+" b="+Obj1.B) ; Test Obj2=new Test( ); System.out.println("="+Obj2.a+" b="+Obj2.B) ; } }
A. a=100 b=200 a=12 b=45
B. a=12 b=45 a=100 b=200
C. a=12 b=200 a=100 b=45
D. a=100 b=45 a=12 b=200
[单项选择]下面程序段的输出结果为 public class Test { int a,b; Test( ) { a=100; b=200; } Test(int x,int y) { a=x; b=y; } public static void main(String args[]) { Test Objl=new Test(12,45); System.out.println("a="+objl.a+" b="+Objl.b); Test Obj2=new Test( ); System.out.println("a="+Obj2.a+" b="+Obj2.b); } }
A. a=100 b=200 a=12 b=45
B. a=12 b=45 a=100 b=200
C. a=12 b=200 a=100 b=45
D. a=100 b=45 a=12 b=200
[填空题]

请写出下面程序的运行结果:
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

int a,b;
Test( )

a=100;
b=200;

Test(int x,int y)

a=x;
b=y;

public static void main(String args[])

Test Objl=new Test(12,45);
System.out.println("a="+objl.a+" b="+Objl.b);
Test Obj2=new Test( );
System.out.println("a="+Obj2.a+" b="+Obj2.b);


A) a=100 b=200
a=12 b=45
B) a=12 b=45
a=100 b=200
C) a=12 b=200
a=100 b=45
D) a=100 b=45
a=12 b=200
[简答题]阅读以下程序代码,写出程序的输出结果。
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 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 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);


我来回答:

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

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码