易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

What can directly access and change the value of the variable name?()

A、 any class

B、 only the Target class

C、 any class in the test package

D、 any class that extends Target

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • 1. public class OuterClass {  2. private double d1 = 1.0;  3. // insert code here  4. }  Which two are valid if inserted at line 3?()  

    A

     static class InnerOne { public double methoda() { return d1; } }

    B

     static class InnerOne { static double methoda() { return d1; } }

    C

     private class InnerOne { public double methoda() { return d1; } }

    D

     protected class InnerOne { static double methoda() { return d1; } }

    E

     public abstract class InnerOne { public abstract double methoda(); }

  • What will be the appearance of an applet with the following init() method?   public void init() {   add(new Button("hello"));  }  

    A、Nothing appears in the applet.

    B、A button will cover the whole area of the applet.

    C、A button will appear in the top left corner of the applet.

    D、A button will appear, centered in the top region of the applet.

    E、A button will appear in the center of the applet.

  • 1. interface TestA { String toString(); }  2. public class Test {  3. public static void main(String[] args) {  4. System.out.println(new TestA() {  5. public String toString() { return “test”; }  6. }  7. }  8. }  What is the result?() 

    A、 test

    B、 null

    C、 An exception is thrown at runtime.

    D、 Compilation fails because of an error in line 1.

    E、 Compilation fails because of an error in line 4.

    F、 Compilation fails because of an error in line 5.

  • 10. public class MyClass {  11.  12. public Integer startingI;  13. public void methodA() {  14. Integer i = new Integer(25);  15. startingI = i;  16. methodB(i);  17. }  18. private void methodB(Integer i2) {  19. i2 = i2.intValue();  20.  21. }  22. }  If methodA is invoked, which two are true at line 20?()

    A

     i2 == startingI returns true.

    B

     i2 == startingI returns false.

    C

     i2.equals(startingI) returns true.

    D

     i2.equals(startingI) returns false.

  • What is the result?()

    A、 test end

    B、 Compilation fails.

    C、 test runtime end

    D、 test exception end

    E、 A Throwable is thrown by main at runtime.

联系客服 会员中心
TOP