单选题A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?()AprivateBno modifierCpublicDprotected

题目
单选题
A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?()
A

 private

B

 no modifier

C

 public

D

 protected


相似考题
更多“单选题A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?()A  privateB  no modifierC  publicD  protected”相关问题
  • 第1题:

    Which keyword can protect a class in a package from accessibility by the classes outside the package()。

    • A、private
    • B、protected
    • C、final
    • D、don’t use any keyword at all (make it default)

    正确答案:D

  • 第2题:

    Which thefollowingstatements about static inner classes is true?()

    • A、 An anonymous class can be declared as static.
    • B、 A static inner class cannot be a static member of the outer class.
    • C、 A static inner class does not require an instance of the enclosing class.
    • D、 Instance member of a static inner class can be referenced using the class name of the staticinner class.

    正确答案:C

  • 第3题:

    What does it mean for a variable in the Application Editor to be defined as a parameter?()

    • A、The variable can be used to pass data to and from subflows.  
    • B、The value for that variable can be supplied via Application Configuration in Application Administration.  
    • C、The value for that variable is defined by the calling application.  
    • D、The variable can be used in conditional steps.  
    • E、The variable can be used to pass data to and from VoiceXML applications.

    正确答案:B

  • 第4题:

    You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?()  

    • A、 Public
    • B、 Private
    • C、 Protected
    • D、 Transient
    • E、 No access modifier is required.

    正确答案:E

  • 第5题:

    Which two demonstrate encapsulation of data?()  

    • A、 Member data have no access modifiers.
    • B、 Member data can be modified directly.
    • C、 The access modifier for methods is protected.
    • D、 The access modifier to member data is private.
    • E、 Methods provide for access and modification of data.

    正确答案:D,E

  • 第6题:

    A class design requires that a member variable cannot be accessible directly outside the class. Which modifier should be used to obtain the access control?()    

    • A、 public
    • B、 no modifier
    • C、 protected
    • D、 private

    正确答案:D

  • 第7题:

    Which three statements are true?()

    • A、A final method in class X can be abstract if and only if X is abstract.
    • B、A protected method in class X can be overridden by any subclass of X.
    • C、A private static method can be called only within other static methods in class X.
    • D、A non-static public final method in class X can be overridden in any subclass of X.
    • E、A public static method in class X can be called by a subclass of X without explicitly referencing the class X.
    • F、A method with the same signature as a private final method in class X can be implemented in a subclass of X.
    • G、A protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.

    正确答案:B,E,F

  • 第8题:

    单选题
    It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()
    A

    Mark the method with the keyword public.

    B

    Mark the method with the keyword protected.

    C

    Mark the method with the keyword private.

    D

    Mark the method with the keyword package.

    E

    Do not mark the method with any accessibility modifiers.


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

  • 第9题:

    多选题
    Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()
    A

    Member variables of the outer instance are always accessible to inner instances, regardless of their      accessibility modifiers.

    B

    Member variables of the outer instance can never be referred to using only the variable name within     the inner instance.

    C

    More than one inner instance can be associated with the same outer instance.

    D

    All variables from the outer instance that should be accessible in the inner instance must be declared     final.

    E

    A class that is declared final cannot have any inner classes.


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

  • 第10题:

    多选题
    Which two demonstrate encapsulation of data? ()
    A

    Member data have no access modifiers.

    B

    Member data can be modified directly.

    C

    The access modifier for methods is protected.

    D

    The access modifier to member data is private.

    E

    Methods provide for access and modification of data.


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

  • 第11题:

    单选题
    Which thefollowingstatements about static inner classes is true?()
    A

     An anonymous class can be declared as static.

    B

     A static inner class cannot be a static member of the outer class.

    C

     A static inner class does not require an instance of the enclosing class.

    D

     Instance member of a static inner class can be referenced using the class name of the staticinner class.


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

  • 第12题:

    单选题
    You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?()
    A

     Public

    B

     Private

    C

     Protected

    D

     Transient

    E

     No access modifier is required.


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

  • 第13题:

    A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?()         

    • A、 private
    • B、 no modifier
    • C、 public
    • D、 protected

    正确答案:B

  • 第14题:

    Which two statements are true of login classes?()

    • A、Users can be members of multiple login classes.
    • B、Login classes define authorization parameters for a user.
    • C、There are five system-defined login classes.
    • D、Login class permission flags can be overridden for certain commands.

    正确答案:B,D

  • 第15题:

    You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?()  

    • A、 public
    • B、 private
    • C、 protected
    • D、 transient
    • E、 default access

    正确答案:E

  • 第16题:

    It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()  

    • A、Mark the method with the keyword public.
    • B、Mark the method with the keyword protected.
    • C、Mark the method with the keyword private.
    • D、Mark the method with the keyword package.
    • E、Do not mark the method with any accessibility modifiers.

    正确答案:E

  • 第17题:

    You want to limit access to a method of a public class to members of the same class. Which access modifier accomplishes this objective?()  

    • A、 Public
    • B、 Private
    • C、 Protected
    • D、 Transient
    • E、 No access modifier is required

    正确答案:B

  • 第18题:

    Which two statements are true about firewall filter configurations?()

    • A、Multiple action modifiers can be included in the same term.
    • B、Only a single action modifier can be included in the same term.
    • C、If an action modifier exists without a terminating action, matching packets will be accepted.
    • D、If an action modifier exists without a terminating action, matching packets will be discarded.

    正确答案:A,C

  • 第19题:

    单选题
    A class design requires that a member variable cannot be accessible directly outside the class. Which modifier should be used to obtain the access control?()
    A

     public

    B

     no modifier

    C

     protected

    D

     private


    正确答案: A
    解析: 这个在前面也有叙述,java有四种访问类型,分别为:public,protected,default,private,其中public变量可以被所有的外部类访问,而pretected的可以被同一个包及该类的子类访问,default即没有任何修饰符的变量可以被同一个包中的类访问,而private变量只能在被该类内部被访问。题目中的外部类应该理解为除该类自身的所有其它类,因此只有使用private可以达到要求 

  • 第20题:

    单选题
    You want to limit access to a method of a public class to members of the same class. Which access modifier accomplishes this objective?()
    A

     Public

    B

     Private

    C

     Protected

    D

     Transient

    E

     No access modifier is required


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

  • 第21题:

    单选题
    Which statement about firefighting foam is TRUE?()
    A

    Foam conducts electricity

    B

    To be most effective,foam should be directed at the base of the fire

    C

    Foam is most effective on burning liquids which are flowing

    D

    Foam can ONLY be used to extinguish class A fires


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

  • 第22题:

    单选题
    What does it mean for a variable in the Application Editor to be defined as a parameter?()
    A

    The variable can be used to pass data to and from subflows.  

    B

    The value for that variable can be supplied via Application Configuration in Application Administration.  

    C

    The value for that variable is defined by the calling application.  

    D

    The variable can be used in conditional steps.  

    E

    The variable can be used to pass data to and from VoiceXML applications.


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

  • 第23题:

    单选题
    You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?()
    A

     public

    B

     private

    C

     protected

    D

     transient

    E

     default access


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