题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-04 21:26:24

[单项选择] 程序:  class   TestApp{  public  static  void main (String[]  args){     int x=6;     if (x>l)  System. out. println("x>l");     else if (x>5)  System. out .println("x>5");     else if (x<10)  System. out. println("xSystem. out .println( "x<29");     else  System. out.println(“以上都不是”);     }     }  上述程序运行后的结果是哪项?()     
A. x>5
B. x>l
C. x<10
D. x<29

更多"程序:&ensp; class&ensp;&ensp;&ensp;Te"的相关试题:

[单项选择] 程序:   class TestApp{   public static void main() String[] args){   for(int i=0;i<10;i++){   if(i==3)   break; 当循环到3时,自动跳出  System.out.print(i);  }  }  }   程序运行后的输出是哪项?()
A. 0123
B. 012
C. 0123456789
D. 012456789
[单项选择] public class TestA{    public void methodA() throws IOException{        //……    } }  public class TestB extends TestA{    public void methodA() throws EOFException{        //……   } }  public class TestC extends TestA{    public void methodA() throws Exception{        //……   } }  当编译类TestC的时候,结果是哪项?() 
A.  正常
B.  编译错误
C.  运行错误
D.  以上都不对
[多项选择] public class test3  {  public static void main(String args[])  {           for(int i = 0; i < 3; i++)  {  for(int j = 3; j >= 0; j--)  {                if(i == j)                    continue;       System.out.println("i="+ i + " j="+j);       }    }       }  }  上面的Java代码编译运行后,下列选项中,()会出现在输出结果中。 
A. i=0 j=3
B. i=0 j=0
C. i=2 j=2
D. i=0 j=2
E. i=1 j=2
[单项选择] 程序:   class TestApp{  int i  public static void main(String[] args){   for(int i=0;i<5;i++)  System.out.print(i+1);   System.out.println(i); (i没有定义)  }  }   上述程序运行后的结果是哪项?()
A.  123456
B.  123455
C.  123450
D.  编译错误
[多项选择] public class TestString3 {  public static void main(String[] args) {  // insert code here  System.out.println(s);  }  }  Which two code fragments, inserted independently at line 3, generate the output 4247?()
A.  String s = “123456789”; s = (s-”123”).replace(1,3,”24”) - “89”;
B.  StringBuffer s = new StringBuffer(”123456789”); s.delete(0,3).replace( 1,3, “24”).delete(4,6);
C.  StringBuffer s = new StringBuffer(”123456789”); s.substring(3,6).delete( 1 ,3).insert(1, “24”);
D.  StringBuilder s = new StringBuilder(”123456789”); s.substring(3,6).delete( 1 ,2).insert( 1, “24”);
E.  StringBuilder s = new StringBuilder(”123456789”); s.delete(0,3).delete( 1 ,3).delete(2,5).insert( 1, “24”);
[单项选择] 下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }
A.  编译报错
B.  2
C.  1
D.  3
[单项选择] public class AssertStuff {  public static void main(String [] args) {  int x= 5;  int y= 7;  assert (x> y): “stuff”;  System.out.println(”passed”);  }  }  And these command line invocations:java AssertStuff java -ea AssertStuff What is the result?()
A.  passed stuff
B.  stuff passed
C.  passed      An AssertionError is thrown with the word “stuff” added to the stack trace.
D.  passed      An AssertionError is thrown without the word “stuff” added to the stack trace.
E.  passed      An AssertionException is thrown with the word “stuff” added to the stack trace.
F.  passed     An AssertionException is thrown without the word “stuff” added to the stack trace.
[单项选择] 程序:  class  TestApp{  public static void main(String[] args){   for(int i=0;i<5;i++)  System.out.print(i+1);           System.out.println(i);     } }  上述程序运行后的结果是哪项?() 
A.  123456
B.  123455
C.  123450
D.  编译错误
[单项选择] public class TestApp{    public int mymethod(){        try{  int i = 0;           int j = 1 / i;  System.out.println(“1”);         }finally{  System.out.print(“4”);       }  return 1;   } }  上述程序运行后的输出是哪项?() 
A.  4
B.  14
C.  41
D.  以上都不对
[单项选择] public class TestApp{   public static void main(String[] args){   try{   String myname = null;   if(myname.length()>2)   System.out.print(“1”);   }catch(NullPointerException e){   System.out.print(“2”);  }  }  }   上述程序运行后的输出是哪项?() 
A.  1
B.  12
C.  21
D.  2
[单项选择] class TestApp{   public static void main (String[ ] args){   for(int i=0;i<10;i++){   if(i==3)   break;   System.out.print (i);  }  }  }   程序运行后的输出是哪项?()  
A. 0123
B. 012
C. 0123456789
D. 012456789

我来回答:

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

订单号:

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