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

题目

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
更多“A member variable”相关问题
  • 第1题:

    A crew member is unconscious and the face is flushed. You should ______.

    A.lay the crew member down with the head and shoulders slightly raised

    B.administer a liquid stimulant

    C.lay the crew member down with the head lower than the feet

    D.attempt to stand the crew member upright to restore consciousness


    正确答案:A

  • 第2题:

    VLSM的含义是()。

    A.Variable Length Subnet Masking

    B.Variable Length Shortest Masking

    C.Very Long/Shortest Masking

    D.Variable Long Subnet Masking


    正确答案:A

  • 第3题:

    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.

    正确答案:A,C

  • 第4题:

    Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()  

    • A、The value of an int is undetermined.
    • B、The value of all numeric types is zero.
    • C、The compiler may issue an error if the variable is used before it is initialized.
    • D、The value of a String variable is "" (empty string).
    • E、The value of all object variables is null.

    正确答案:B,E

  • 第5题:

    VLSM的含义是()

    • A、Variable Length Subnet Masking
    • B、Variable Length Shortest Masking
    • C、Very Long/Shortest Masking
    • D、Variable Long Subnet Masking
    • E、Variable Length Short Measurement

    正确答案:A

  • 第6题:

    temp=’this is a temped variable’;echo foo${temp}上述命令执行的结果为()

    • A、foo
    • B、foo$temp
    • C、foo’this is a temped variable’
    • D、foothis is a temped variable

    正确答案:D

  • 第7题:

    单选题
    An administrator needs to add the /usr/vac/bin directory to their PATH environment variable for the current session.  Which of the following will accomplish this task()
    A

    path=$path:/usr/vac/bin; export path

    B

    path.=/usr/vac/bin; export $path

    C

    Modify the path environment variable in /etc/profile

    D

    Modify the path environment variable in /.profile


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

  • 第8题:

    单选题
    The auto-complete feature in the JUNOS CLI is triggered by which method?()
    A

    space bar for both command and variable completion

    B

    space bar for command completion;tab key for variable completion

    C

    space bar for variable completion;tab key for command completion

    D

    tab key for variable and command completion;space bar for command completion


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

  • 第9题:

    单选题
    () is made of a boss with separated blades mounted into it.
    A

    A variable pitch propeller

    B

    A variable pitch nut

    C

    A fixed pitch parallel

    D

    A fixed pitch screw


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

  • 第10题:

    单选题
    You create a Web site that is for members only. The Web site allows members to create lists of users that have access to information about member profiles. The name of the list is stored in the listName variable. The user name of the user to whom access is given is stored in the username variable. You need to enable members to manage their lists of users. Which code segment should you use? ()
    A

    Roles.CreateRole(listName);User.InInRole(listName);

    B

    Roles.CreateRole(listName);Roles.AddUserToRole(useName, listName);

    C

    Roles.RoleExists(listName);Roles.AddUserToRole(useName, listName);

    D

    Roles.RoleExists(listName);User.InInRole(listName);


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

  • 第11题:

    单选题
    A crew member is unconscious and the face is flushed. You should().
    A

    lay the crew member down with the head and shoulders slightly raised

    B

    administer a liquid stimulant

    C

    lay the crew member down with the head lower than the feet

    D

    attempt to stand the crew member upright to restore consciousness


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

  • 第12题:

    单选题
    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
    解析: 暂无解析

  • 第13题:

    ______ is the address of a variable or a variable in which the address of another variable is stored.

    A.Director

    B.Pointersystem

    C.Array

    D.Record


    正确答案:B
    解析:译文的含义是:()是一个变量的地址或存储了其他变量地址的变量。A、B、C、D各选项的意思分别是:控制器、指针、数组、记录。很明显,题目描述的是指针,所以应该选择B。

  • 第14题:

    ______is the address of.a variable or a variable in which the address of another variable is stored.

    A.Director

    B.Pointer

    C.Array

    D.Record


    正确答案:B
    解析:指针是一个变量的地址或者是存储了另一个变量地址的变量。

  • 第15题:

    A public member vairable called MAX_LENGTH which is int type, the value of the variable remains constant value 100. Use a short statement to define the variable.()   

    • A、 public int MAX_LENGTH=100;
    • B、 final int MAX_LENGTH=100;
    • C、 final public int MAX_LENGTH=100;
    • D、 public final int MAX_LENGTH=100;

    正确答案:D

  • 第16题:

    VLSM的含义是()。

    • A、Variable Length Subnet Masking
    • B、Variable Length Shortest Masking
    • C、Very Long/Shortest Masking
    • D、Variable Long Subnet Masking

    正确答案:A

  • 第17题:

    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

  • 第18题:

    Which substitution variable would you use if you want to reuse the variable without prompting the user each time?()

    • A、&
    • B、ACCEPT
    • C、PROMPT
    • D、&&

    正确答案:D

  • 第19题:

    多选题
    Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()
    A

    The value of an int is undetermined.

    B

    The value of all numeric types is zero.

    C

    The compiler may issue an error if the variable is used before it is initialized.

    D

    The value of a String variable is  (empty string).

    E

    The value of all object variables is null.


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

  • 第20题:

    单选题
    A public member vairable called MAX_LENGTH which is int type, the value of the variable remains constant value 100. Use a short statement to define the variable.()
    A

     public int MAX_LENGTH=100;

    B

     final int MAX_LENGTH=100;

    C

     final public int MAX_LENGTH=100;

    D

     public final int MAX_LENGTH=100;


    正确答案: B
    解析: Java中共有变量使用public定义,常量变量使用final,另外注意的是修饰符的顺序,一个最完整的修饰是public static final int varial_a=100;这个顺序不能错,这和c++中也是 不同的。而答案c恰恰错在修饰符的顺序上。

  • 第21题:

    单选题
    Which substitution variable would you use if you want to reuse the variable without prompting the user each time?()
    A

    &

    B

    ACCEPT

    C

    PROMPT

    D

    &&


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

  • 第22题:

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

  • 第23题:

    单选题
    Who may perform as a lookout().
    A

    A member of the engineering watch

    B

    A member of the navigational watch

    C

    A member of the Stewards Department

    D

    All of the above


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