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

[单项选择] 现有:  void topGo()  {      try  {  middleGo();  }  catch  (Exception e)  {      System.out.print("catch");      }      }  void middleGo()  throws Exception  {     go();  system.out.print("late middle");     }  void go()  throws ExceptiOn  {     throw new Exception();     } 如果调用 topGo () ,则结果为:() 
A.  late middle
B.  catch
C.  late middle catch
D.  catch Iate middle

更多"现有:  void topGo() &e"的相关试题:

[单项选择] 现有:  import java.util.*;      class  ScanStuff  {  public  static void main (String  []  args)  {     String S= "x,yy,123";  Scanner sc = new Scanner (s);      while  (sc.hasNext())  System.out.print (sc.next()  +" ");     }      }  结果是什么?()     
A.   x yy
B.  x,yy,123
C.   x yy 123
D.   x,yy
E. 编译失败
F. 运行的时候有异常抛出
[简答题] 已知下列一组语句:           ORG  2000H  ARY  DW   3,$+4,5,6  CNT  EQU  $ —ARY          DB   7,8,CNT,9  执行语句MOV AX,ARY+2和MOV  BX,ARY+10后,AX和BX分别是多少?画出内存分配图。
[单项选择] 现有如下类型:      a - java.util.Hashtable      b - java.util.List      c - java.util.ArrayList      d - java.util.SortedSet      和定义:      1-使用本接口,允许用户控制集合中每个元素的插入位置。      2-使用本集合,确保用户可以按照递增或元素的自然顺序遍历集合。      3-本具体类型允许空元素及基于索引的访问。      4-本集合是同步的。      哪一组匹配是对的?()     
A. 2描述d;  3描述b。
B. 1描述b;  3描述c。
C. 3描述a;  4描述b。
D. 4描述a;  2描述c。
[单项选择] 现有:   class Parser extends Utils {   public static void main(String [] args) {     System.out.print(new Parser().getInt("42"));    }   int getInt(String arg) {  return Integer.parseInt(arg);  }    }   class Utils {     int getInt(String arg) throws Exception { return 42; }    }    结果为()  
A.  42
B.  编译失败。
C.  无输出结果。
D.  运行时异常被抛出。
[单项选择] 现有:   1.  class Alpha { void m1() {} }   2.  class Beta extends Alpha { void m2() { } }   3.  class Gamma extends Beta { }   4.   5.  class GreekTest {   6.    public static void main(String [] args) {   7.      Alpha [] a = {new Alpha(), new Beta(), new Gamma() };   8.      for(Alpha a2 : a) {   9.        a2.m1();    10.       if (a2 instanceof Beta || a2 instanceof Gamma)    11.         //insert code here   12.     }    13.   }   14. }    哪一行代码插入到第11行,将编译但是会在运行时产生异常?() 
A.  a2.m2();
B.  ((Beta)a2).m2();
C.  ((Alpha)a2).m2();
D.  ((Gamma)a2).m2();
[单项选择] 现有:  class  Parser extends  Utilis  {  public static void main (String  []  args)  {  try  {  System. out.print (new  Parser ( ) .getlnt ("42")} ;     }  catch (NumberFormatException n) {  System.out .println ( "NFExc" ) ;   }     }  int getlnt (String arg)  throws NumberFormatException{    return Integer.parselnt (arg) ;     }     class Utils {  int getlnt (String arg)  {  return 42;  }    }  结果为 :()
A.  NFExc
B.  42
C.  42NFExc
D. 编译失败
[单项选择] public class test (      private static int j = 0;  private static boolean methodB(int k) (  j += k;  return true;  )  public static void methodA(int  i)(  boolean b:     b = i < 10 | methodB (4);  b = i < 10 || methodB (8);  )  public static void main (String args[])(   methodA (0);  system.out.printIn(j);  )  )   What is the result?()  
A.  The program prints “0”
B.  The program prints “4”
C.  The program prints “8”
D.  The program prints “12”
E.  The code does not complete.
[填空题] Public class test (    Public static void stringReplace (String text) (    Text = text.replace („j„ , „i„);    )      public static void bufferReplace (StringBuffer text) (    text = text.append (“C”)   )      public static void main (String args ){  String textString = new String (“java”);    StringBuffer text BufferString = new StringBuffer (“java”);      stringReplace (textString);    BufferReplace (textBuffer);      System.out.printIn (textString + textBuffer);    }   )   What is the output?()
[单项选择] 现有:   1. class Book {   2. private final void read() { System.out.print("book "); }   3. }   4. class Page extends Book {   5. public static void main(String [] args) {   6. // insert code here   7. }   8. private final void read() { System.out.print("page "); }   9. }   和如下三个代码片段( x, y, z ):   x. // just a comment   y. new Page().read();  z. new Book().read();   分别插入到第6行,有几个允许代码通过编译并可以运行且无异常?() 
A.  0
B.  1
C.  2
D.  3
[单项选择] 现有:  class Tree {  private static String tree = "tree ";  String getTree ()  {  return tree;  }       }  class Elm extends Tree {  private static String tree = "elm ";  public static void main (String  []  args)  {       new Elm() .go (new Tree())  ;      } }  void go (Tree t)  {  String  s =  t.getTree () +Elm.tree  +  tree  +   (new  Elm() .getTree ()) ;      System.out.println (s) ;}     结果为:()                 
A.  elm elm elm elm
B.  tree elm elm elm
C.  tree elm elm tree
D.  tree elm tree elm
[单项选择] 现有:  class Birds {  public static void main (String  []  args)  {   try {  throw new Exception () ;    } catch (Exception e) {   try {   throw new Exception () ;  }  catch  (Exception e2)  {  System.out.print ("inner           "); }   System. out.print ( "middle" ) ;    }  System.out.print ("outer") ;    }    }  结果是()
A.  inner outer
B.  middle outer
C.  inner middle outer
D. .编译失败
[单项选择] 现有:  public class Tester {  public static void main (String[] args)  {      intx-5;  Integer xl=x;  Integer x2=x;     int x3=new Integer(5);  system..ut.print(x1.equals(x));      system..ut.print(xl==x);  system..ut.print(x2.equals(xl));      system..ut.print(x2==xl);      system..ut.print(x2==x3);  system..ut.print(x2.equals(x3));         }      }      结果为:()     
A. 编译失败
B. falsefalsetruetruetruetrue
C. truetruetruetruetruetrue
D. falsefalsetruetruetruefalse
E. truefalsetruefalsefalsetrue
F. 运行时异常被抛出
[单项选择] 现有:  1. interface Animal {  2. void eat();  3. }  4.  5. // insert code here  6.  7. public class HouseCat extends Feline {  8. public void eat() { }  9. }   和五个声明:  abstract class Feline implements Animal { }  abstract class Feline implements Animal { void eat(); }  abstract class Feline implements Animal { public void eat(); }  abstract class Feline implements Animal { public void eat() { } }  abstract class Feline implements Animal { abstract public void eat(); }  分别插入到第5行,有几个可以通过编译?() 
A. 0
B. 1
C. 2
D. 3
[多项选择] public class MethodOver {   public void setVar (int a, int b, float c) {   }   }   Which two overload the setVar method?()
A.  Private void setVar (int a, float c, int b) {}
B.  Protected void setVar (int a, int b, float c) {}
C.  Public int setVar (int a, float c, int b) (return a;)
D.  Public int setVar (int a, int b, float c) (return a;)
E.  Protected float setVar (int a, int b, float c) (return c;)
[多项选择] public class ConstOver  {   public ConstOver (int x, int y, int z) {   }  }   Which two overload the ConstOver constructor? ()
A. ConstOver(){}
B. Protected int ConstOver (){}
C. Private ConstOver (int z, int y, byte x) {}
D. Public Object ConstOver (int x, int y, int z) {}
E.  Public void ConstOver (byte x, byte y, byte z){}
[单项选择] 1. package foo;  2.    3. import java.util.Vector;  4.    5. private class MyVector extends Vector {  6. int i = 1;  7. public MyVector()  {  8. i = 2;  9.    }  10. }  11.    12. public class MyNewVector extends MyVector {  13. public MyNewVector ()  {  14. i = 4;  15. }  16. public static void main (String args [])  {  17. MyVector v = new MyNewVector();  18.   }  19. }     The file MyNewVector.java is shown in the exhibit.  What is the result?()  
A.  Compilation will succeed.
B.  Compilation will fail at line 5.
C.  Compilation will fail at line 6.
D.  Compilation will fail at line 14.
E.  Compilation will fail at line 17.
[多项选择] String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()   
A.  s.equals(t);
B.  t.equals(c);
C.  s==t;
D.  t.equals(new String("hello"));
E.  t==c;

我来回答:

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

订单号:

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