题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-06 07:17:31

[单项选择]下列程序执行后,j的值是  public class Testggg     public static void main(String args[ ])         int j=1;     for(int i=7;i>0;i-=2)      j * =2;     System.out.println(j);
A. 15
B. 1
C. 32
D. 16

更多"下列程序执行后,j的值是  public class Testggg "的相关试题:

[单项选择]下面的程序执行后,屏幕上显示的应是 public class Exam{ public static void main(String[])args){ char char1[]={’t’,’e’,’s’,’t’}; char char2[]={’t’,’e’,’s’,’t’,’l’} String s1=new String(char 1); String s2=new String(char2,0,4); System.out.println(s1.equals(s2)); } }
A. true
B. false
C. test
D. 编译错误
[单项选择]阅读下面程序 public class Increment { public static void main( String args[] ){ int c; c=5; System.out.println( c ); System.out.println( c++ ); System.out.println( c ); } )程序运行结果是( )。
A. 5 6 6
B. 5 5 6
C. 6 7 7
D. 6 6 6
[单项选择]阅读下列程序:
class ThreadTest extends Thread
public static void main(String[]args)
Thread t=new Thread(this);
t.start( );

public void run( )
System.out.print("A thread test.");
对该程序而言,正确结论是 ( )
A. 该程序能够通过编译并打印输出“A thread test.”
B. 该程序能够通过编译,但运行时将不调用ThreadTest类中的run()方法,因此不产生任何输出
C. 该程序存在编译错误,因为在main()方法中不能使用this指针
D. 上述选项都不正确
[单项选择]下面程序的运行结果为 #include<iostream.h> Class A static int n; public: A( ) {n=1;} A(int num) {n=num;} void print( ) {cout < < n;} }; int A: :n=2; void main( ) { A a,b(3) ; a. print( ) ; b. print( ) ; cout < < endl; } A) 11 B) 13 C) 23 D) 33
[单项选择]有下面程序段: Public class ArrayTest { Public static void main(String args[]) { int[] intArray=new int[3]; for(int I=0;I<3;I++) { intArray[I]=I+2; System.out.println("IntArray["+I+"]"-"+intArray[I]); } System.out.println("------------"); Int arrLen=4; IntArray=new int[arrLen]; For(int j=intArray.length;j>=0;j--} { intArray [j]=j*3; System. out.println("hello"+intArray[j]); } } } 则运行的结果是( )。
A. 编译出错
B. 编译通过,但运行出错
C. 可以运行,但有错误
D. 以上都不对
[单项选择]下列程序执行的结果是( )。
public class Test
public static void main(String[ ] args)
int i, j, k;
for(int n=100; n<=200; n++ )
i = n/100;
j = n/10-i* 10;
k = n%10;
if(n == Math. pow(i, 3) + Math. pow(j, 3) + Math. pow(k, 3))
System. out. println(n);


A. 153
B. 167
C. 173
D. 137
[单项选择]下面程序的输出结果为( )。
public class Test
public static void main (String args[])
String X="ABCD";
String Y="EFG";
X=X.substring (X.length( )-Y.length( ));
System.out.println(X);


A. ABC
B. BCD
C. EFG
D. ABCDEFG
[单项选择]执行下面程序后输出的正确结果是
Public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(”,”);
System.out.print(x/y);


A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]下面程序的输出结果是( )。
public class Sun

public static void main(String args[])

int[]a=1,2,3,4;
int j=1,s=0;
for(int i=3;i>=0;i--)

s=s+a[i]*j;
j=j*10;

System.out.println(s);


A. 1234
B. 21
C. 43
D. 4321
[单项选择]下列程序的输出结果为( )。
public class Test
public static void main (String[] args)
int i,j,k,a=3,b=2;
i=(--a==b++) --a:++b;
j=a++;
k=b;
System. out. println("i="+i+" ,j =" +j+",k ="+k);


A. i=2, j=1, k=3
B. i=1, j=1, k=2
C. i=4, j=2, k=4
D. i=1, j=1, k=3
[单项选择]下列程序段的输出是( )。
public class Test
public static void main (String args[ ])
String ss1 = new String("hello");
String ss2 = new String("hello");
System. out. println(ssl == ss2);
System. out. println (ss1. equals(ss2));


A. true, false
B. true, true
C. false, true
D. false, false
[单项选择]下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.printin( "a="+a+"b="+b) ; c-(b==false); System.out.println(b="+b+"e="+c) ; } }
A. a=true b=false b=true c=false
B. a=true b=false b=true c=true
C. a=true b=true b=true c=false
D. a=false b=false b=true c=false

我来回答:

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

订单号:

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