单选题11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Sno

题目
单选题
11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Snoochy(); 23.snoog=null; 24.//more code here 25.} Which statement is true about the objects referenced by snoog,snooch,and booch immediately after line 23 executes?()
A

None of these objects are eligible for garbage collection.

B

Only the object referenced by booch is eligible for garbage collection.

C

Only the object referenced by snoog is eligible for garbage collection.

D

Only the object referenced by snooch is eligible for garbage collection.

E

The objects referenced by snooch and booch are eligible for garbage collection.


相似考题
更多“单选题11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Sno”相关问题
  • 第1题:

    以下是JAVA中正确的入口方法是? () 

    • A、 public static void main(String[] args){}
    • B、 public static void main(String args){}
    • C、 public void main(String[] args){}
    • D、 public static int main(String[] args){}

    正确答案:A

  • 第2题:

    下列有关main()方法的签名正确的是哪些?()

    • A、 public static void main(String[] args){}
    • B、 public static void main(){}
    • C、 public static void main(String args[]){}
    • D、 public void static main(String[] args){}

    正确答案:A,C

  • 第3题:

    下面哪些选项是正确的main方法说明?()

    • A、 public main(String args[])
    • B、 public static void main(String args[])
    • C、 private static void main(String args[])
    • D、 void main()

    正确答案:B

  • 第4题:

    11.classA {  12. public void process() { System.out.print(”A “); } }  13. class B extends A {  14. public void process() throws RuntimeException {  15. super.process();  16. if (true) throw new RuntimeException();  17. System.out.print(“B”); }}  18. public static void main(String[] args) {  19. try { ((A)new B()).process(); }  20. catch (Exception e) { System.out.print(”Exception “); }  21. }  What is the result?() 

    • A、 Exception
    • B、 A Exception
    • C、 A Exception B
    • D、 A B Exception
    • E、 Compilation fails because of an error in line 14.
    • F、 Compilation fails because of an error in line 19.

    正确答案:B

  • 第5题:

    下面哪些main方法可用于程序执行()

    • A、public static void main(String[]args)
    • B、public static void main(String[]x)
    • C、public static void main(Stringargs[])
    • D、public void main(String[]args)

    正确答案:A,B,C

  • 第6题:

    Given:   11. static class A {   12. void process() throws Exception { throw new Exception(); }   13. }   14. static class B extends A {   15. void process() { System.out.println("B "); }   16. }   17. public static void main(String[] args) {   18. A a = new B();   19. a.process();   20. }   What is the result? ()

    • A、 Compilation fails because of an error in line 19.
    • B、 An exception is thrown at runtime.
    • C、 B
    • D、 Compilation fails because of an error in line 18.
    • E、 Compilation fails because of an error in line 15. 
    • F、 The code runs with no output.

    正确答案:A

  • 第7题:

    单选题
    11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){snooch=s;} 19.} And the statements: 21.public static void main(String[]args){ 22.Snoochy snoog=new Snoochy(); 23.snoog=null; 24.//more code here 25.} Which statement is true about the objects referenced by snoog,snooch,and booch immediately after line 23 executes?()
    A

    None of these objects are eligible for garbage collection.

    B

    Only the object referenced by booch is eligible for garbage collection.

    C

    Only the object referenced by snoog is eligible for garbage collection.

    D

    Only the object referenced by snooch is eligible for garbage collection.

    E

    The objects referenced by snooch and booch are eligible for garbage collection.


    正确答案: C
    解析: 暂无解析

  • 第8题:

    多选题
    Which declarations will allow a class to be started as a standalone program?()
    A

    public void main(String args[])

    B

    public void static main(String args[])

    C

    public static main(String[] argv)

    D

    final public static void main(String [] array)

    E

    public static void main(String args[])


    正确答案: C,E
    解析: 暂无解析

  • 第9题:

    单选题
    11.classA {  12. public void process() { System.out.print(”A “); } }  13. class B extends A {  14. public void process() throws RuntimeException {  15. super.process();  16. if (true) throw new RuntimeException();  17. System.out.print(“B”); }}  18. public static void main(String[] args) {  19. try { ((A)new B()).process(); }  20. catch (Exception e) { System.out.print(”Exception “); }  21. }  What is the result?()
    A

     Exception

    B

     A Exception

    C

     A Exception B

    D

     A B Exception

    E

     Compilation fails because of an error in line 14.

    F

     Compilation fails because of an error in line 19.


    正确答案: F
    解析: 暂无解析

  • 第10题:

    单选题
    Given:   11. static class A {   12. void process() throws Exception { throw new Exception(); }   13. }   14. static class B extends A {   15. void process() { System.out.println("B "); }   16. }   17. public static void main(String[] args) {   18. A a = new B();   19. a.process();   20. }   What is the result? ()
    A

     Compilation fails because of an error in line 19.

    B

     An exception is thrown at runtime.

    C

     B

    D

     Compilation fails because of an error in line 18.

    E

     Compilation fails because of an error in line 15. 

    F

     The code runs with no output.


    正确答案: E
    解析: 暂无解析

  • 第11题:

    单选题
    声明Java独立应用程序main()方法时,正确表达是()。
    A

    public static void main(String[]args){…}

    B

    private static void main(String args[]){…}

    C

    public void main(String args[]){…}

    D

    public static void main(){…}


    正确答案: C
    解析: 暂无解析

  • 第12题:

    多选题
    下面哪些main方法可用于程序执行()
    A

    public static void main(String[]args)

    B

    public static void main(String[]x)

    C

    public static void main(Stringargs[])

    D

    public void main(String[]args)


    正确答案: B,D
    解析: 暂无解析

  • 第13题:

    Which declarations will allow a class to be started as a standalone program?()  

    • A、public void main(String args[])
    • B、public void static main(String args[])
    • C、public static main(String[] argv)
    • D、final public static void main(String [] array)
    • E、public static void main(String args[])

    正确答案:D,E

  • 第14题:

    11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19. }  What is the result?() 

    • A、 B
    • B、 The code runs with no output.
    • C、 Compilation fails because of an error in line 12.
    • D、 Compilation fails because of an error in line 15.
    • E、 Compilation fails because of an error in line 18.

    正确答案:A

  • 第15题:

    声明Java独立应用程序main()方法时,正确表达是()。

    • A、public static void main(String[]args){…}
    • B、private static void main(String args[]){…}
    • C、public void main(String args[]){…}
    • D、public static void main(){…}

    正确答案:A

  • 第16题:

    11. class Snoochy {  12. Boochybooch;  13. public Snoochy() { booch = new Boochy(this); }  14. }  15.  16. class Boochy {  17. Snoochy snooch;  18. public Boochy(Snoochy s) { snooch = s; }  19. }  And the statements:  21. public static void main(String[] args) {  22. Snoochy snoog = new Snoochy();  23. snoog = null;  24. // more code here  25. }  Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?() 

    • A、 None of these objects are eligible for garbage collection.
    • B、 Only the object referenced by booch is eligible for garbage collection.
    • C、 Only the object referenced by snoog is eligible for garbage collection.
    • D、 Only the object referenced by snooch is eligible for garbage collection.
    • E、 The objects referenced by snooch and booch are eligible for garbage collection.

    正确答案:E

  • 第17题:

    11. static classA {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B “); }  16. }  17. public static void main(String[] args) {  18.A a=new B();  19. a.process();  20.}  What is the result?() 

    • A、 B
    • B、 The code runs with no output.
    • C、 An exception is thrown at runtime.
    • D、 Compilation fails because of an error in line 15.
    • E、 Compilation fails because of an error in line 18.
    • F、 Compilation fails because of an error in line 19.

    正确答案:F

  • 第18题:

    单选题
    11. static classA {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B “); }  16. }  17. public static void main(String[] args) {  18.A a=new B();  19. a.process();  20.}  What is the result?()
    A

     B

    B

     The code runs with no output.

    C

     An exception is thrown at runtime.

    D

     Compilation fails because of an error in line 15.

    E

     Compilation fails because of an error in line 18.

    F

     Compilation fails because of an error in line 19.


    正确答案: B
    解析: 暂无解析

  • 第19题:

    单选题
    作为Java应用程序入口的main方法,其声明格式可以是()。
    A

    public static void main(String[] args)

    B

    public static int main(String[] args)

    C

    public void main(String[] args)

    D

    public int main(String[] args)


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    11. class Snoochy {  12. Boochybooch;  13. public Snoochy() { booch = new Boochy(this); }  14. }  15.  16. class Boochy {  17. Snoochy snooch;  18. public Boochy(Snoochy s) { snooch = s; }  19. }  And the statements:  21. public static void main(String[] args) {  22. Snoochy snoog = new Snoochy();  23. snoog = null;  24. // more code here  25. }  Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?()
    A

     None of these objects are eligible for garbage collection.

    B

     Only the object referenced by booch is eligible for garbage collection.

    C

     Only the object referenced by snoog is eligible for garbage collection.

    D

     Only the object referenced by snooch is eligible for garbage collection.

    E

     The objects referenced by snooch and booch are eligible for garbage collection.


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    以下是JAVA中正确的入口方法是? ()
    A

     public static void main(String[] args){}

    B

     public static void main(String args){}

    C

     public void main(String[] args){}

    D

     public static int main(String[] args){}


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19. }  What is the result?()
    A

     B

    B

     The code runs with no output.

    C

     Compilation fails because of an error in line 12.

    D

     Compilation fails because of an error in line 15.

    E

     Compilation fails because of an error in line 18.


    正确答案: D
    解析: 暂无解析

  • 第23题:

    多选题
    下列有关main()方法的签名正确的是哪些?()
    A

    public static void main(String[] args){}

    B

    public static void main(){}

    C

    public static void main(String args[]){}

    D

    public void static main(String[] args){}


    正确答案: D,B
    解析: 暂无解析

  • 第24题:

    单选题
    下面哪些选项是正确的main方法说明?()
    A

     public main(String args[])

    B

     public static void main(String args[])

    C

     private static void main(String args[])

    D

     void main()


    正确答案: B
    解析: 暂无解析