Which of the following statements about variables and scope are true?() A、 Local variables defined inside a method are destroyed when the method is exited.B、 Local variables are also called automatic variables.C、 Variables defined outside a method are cre

题目

Which of the following statements about variables and scope are true?() 

  • A、 Local variables defined inside a method are destroyed when the method is exited.
  • B、 Local variables are also called automatic variables.
  • C、 Variables defined outside a method are created when the object is constructed.
  • D、 A method parameter variable continues to exist for as long as the object is needed in which the method is defined.

相似考题
更多“Which of the following statements about variables and scope are true?() A、 Local variables defined inside a method are destroyed when the method is exited.B、 Local variables are also called automatic variables.C、 Variables defined outside a method are cre”相关问题
  • 第1题:

    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

  • 第2题:

    In the Expression Editor panel of CRS Script Editor, why would you use the Java tab? ()

    • A、to execute a specified method of a Java class  
    • B、to reference a variable or invoke a method of a custom Java Object  
    • C、to pass variables between two different workflows  
    • D、to create an object for the purpose of executing methods on a remote computer  
    • E、to get a reference to the Contact and Session states  
    • F、to allow for arguments to be passed to a specified method

    正确答案:A,B,E

  • 第3题:

    Which two statements are true regarding the creation of a default constructor?()   

    • A、 The default constructor initializes method variables.
    • B、 The default constructor invokes the no-parameter constructor of the superclass.
    • C、 The default constructor initializes the instance variables declared in the class.
    • D、 If a class lacks a no-parameter constructor,, but has other constructors, the compiler creates a default constructor.
    • E、 The compiler creates a default constructor only when there are no other constructors for the class.

    正确答案:C,E

  • 第4题:

    To make audit information more productive, the DBA executes the following command before startingan audit operation:  SQL> ALTER SYSTEM SET AUDIT_TRAIL=DB,EXTENDED SCOPE=SPFILE;  Which statement is true regarding the audit record generated when auditing starts after restarting thedatabase()

    • A、It contains only the plan for the SQL statement executed by the user.
    • B、It contains the SQL text executed by the user and the bind variables used with it.
    • C、It contains the plan and statistics associated with the SQL statement executed by the user.
    • D、It contains the plan for the SQL statement executed by the user and the bind variables used with it.

    正确答案:B

  • 第5题:

    An administrator created a .env file in a user’s home directory to configure a number of custom environment variables for a local application. However, after the user logs out and then logs back into the system, the custom variables are not being set What is the most likely reason that the custom .env file is being ignored?()

    • A、A shell other than ksh is being used by the user.
    • B、The line ’export ENV=$HOME/.env’ is missing from /etc/profile.
    • C、The line ’export ENV=$HOME/.env’ is missing from the user’s .profile.
    • D、The env_profile attribute is not defined for the user within /etc/security/user.

    正确答案:C

  • 第6题:

    You are developing a class library. Portions of your code need to access system environment variables. You need to force a runtime SecurityException only when callers that are higher in the call stack do not have the necessary permissions. Which call method should you use?()

    • A、set.Demand();
    • B、set.Assert();
    • C、set.PermitOnly();
    • D、set.Deny();

    正确答案:A

  • 第7题:

    多选题
    Which three statements are true?()
    A

    The default constructor initializes method variables.

    B

    The default constructor has the same access as its class.

    C

    The default constructor invoked the no-arg constructor of the superclass.

    D

    If a class lacks a no-arg constructor, the compiler always creates a default constructor.

    E

    The compiler creates a default constructor only when there are no other constructors for the class.


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

  • 第8题:

    多选题
    Which statements concerning the methods notify() and notifyAll() are true?
    A

    Instances of class Thread have a method called notify().

    B

    A call to the method notify() will wake the thread that currently owns the monitor of the object.

    C

    The method notify() is synchronized.

    D

    The method notifyAll() is defined in class Thread.

    E

    When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.


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

  • 第9题:

    多选题
    Which of the following statements about variables and their scopes are true? ()
    A

    Instance variables are member variables of a class.

    B

    Instance variables are declared with the static keyword.

    C

    Local variables defined inside a method are created when the method is executed.

    D

    Local variables must be initialized before they are used.


    正确答案: B,D
    解析: 类中有几种变量,分别是:局部变量(英文可以为:local/automatic/temporary/stack variable)是定义在方法里的变量;实例变量(英文为:instance variable)是在方法外而在类声明内定义的变量,有时也叫成员变量;类变量(英文为:class variable)是用关键字static声明的实例变量,他们的生存期分别是:局部变量在定义该变量的方法被调用时被创建,而在该方法退出后被撤销;实例变量在使用new Xxxx()创建该类的实例时被创建,而其生存期和该类的实例对象的生存期相同;类变量在该类被加载时被创建,不一定要用new Xxxx()创建,所有该类的实例对象共享该类变量,其生存期是类的生存期。任何变量在使用前都必须初始化,但是需要指出的是局部变量必须显式初始化,而实例变量不必,原始类型的实例变量在该类的构造方法被调用时为它分配的缺省的值,整型是0,布尔型是false,而浮点型是0.0f,引用类型(类类型)的实例变量的缺省值是null(没有进行实际的初始化,对它的使用将引起NullPointException),类变量的规则和实例变量一样,不同的是类变量的初始化是在类被加载时。

  • 第10题:

    多选题
    Which two statements are true regarding the creation of a default constructor?()
    A

    The default constructor initializes method variables.

    B

    The compiler always creates a default constructor for every class.

    C

    The default constructor invokes the no-parameter constructor of the superclass.

    D

    The default constructor initializes the instance variables declared in the class.

    E

    When a class has only constructors with parameters, the compiler does not create a default constructor.


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

  • 第11题:

    多选题
    Which two statements are true regarding the creation of a default constructor?()
    A

    The default constructor initializes method variables.

    B

    The default constructor invokes the no-parameter constructor of the superclass.

    C

    The default constructor initializes the instance variables declared in the class.

    D

    If a class lacks a no-parameter constructor,, but has other constructors, the compiler creates a default constructor.

    E

    The compiler creates a default constructor only when there are no other constructors for the class.


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

  • 第12题:

    多选题
    Which of the following statements about variables and scope are true?()
    A

    Local variables defined inside a method are destroyed when the method is exited.

    B

    Local variables are also called automatic variables.

    C

    Variables defined outside a method are created when the object is constructed.

    D

    A method parameter variable continues to exist for as long as the object is needed in which the method is defined.


    正确答案: B,D
    解析: 本题是讨论变量的类型及作用域。

  • 第13题:

    Which of the following statements about authentication responses and conditions is true? ()(Choosetwo.)

    • A、When a router receives a failure response, it stops querying authentication methods.
    • B、When a router receives an error response, it stops querying authentication methods.
    • C、If the router receives a failure response from an authentication method, it queries the next method.
    • D、The router does not differentiate between failure and error responses; the authentication process is always interrupted.
    • E、If it receives no response from the authentication method, a router will determine the error condition On its own; the router also has the option to proceed to the next method in a list if configured accordingly.

    正确答案:A,E

  • 第14题:

    Which three statements are true?()

    • A、 The default constructor initializes method variables.
    • B、 The default constructor has the same access as its class.
    • C、 The default constructor invoked the no-arg constructor of the superclass.
    • D、 If a class lacks a no-arg constructor, the compiler always creates a default constructor. 
    • E、 The compiler creates a default constructor only when there are no other constructors for the class.

    正确答案:B,C,E

  • 第15题:

    Which two statements are true regarding the creation of a default constructor?() 

    • A、 The default constructor initializes method variables.
    • B、 The compiler always creates a default constructor for every class.
    • C、 The default constructor invokes the no-parameter constructor of the superclass.
    • D、 The default constructor initializes the instance variables declared in the class.
    • E、 When a class has only constructors with parameters, the compiler does not create a default constructor.

    正确答案:D,E

  • 第16题:

    Which statements concerning the methods notify() and notifyAll() are true?  

    • A、Instances of class Thread have a method called notify().
    • B、A call to the method notify() will wake the thread that currently owns the monitor of the object.
    • C、The method notify() is synchronized.
    • D、The method notifyAll() is defined in class Thread.
    • E、When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.

    正确答案:A,E

  • 第17题:

    Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()

    • A、It can be invoked only from the doGet or doPost methods.
    • B、It can be used independently of the getRemoteUser method.
    • C、Can return "true" even when its argument is NOT defined as a valid role name in the deployment descriptor.
    • D、Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.

    正确答案:B,C

  • 第18题:

    Which of the following statements about variables and their scopes are true? ()   

    • A、 Instance variables are member variables of a class.
    • B、 Instance variables are declared with the static keyword.
    • C、 Local variables defined inside a method are created when the method is executed.
    • D、 Local variables must be initialized before they are used.

    正确答案:A,C,D

  • 第19题:

    单选题
    Given: Which statement is true?()
    A

     The cardID and limit variables break polymorphism.

    B

     The code demonstrates polymorphism.

    C

     The ownerName variable breaks encapsulation.

    D

     The setCardInformation method breaks encapsulation.

    E

     The class is fully encapsulated.


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

  • 第20题:

    多选题
    Given that Thing is a class, how many objects and reference variables are created by the following code?()   Thing item, stuff;   item = new Thing();   Thing entity = new Thing();
    A

    One object is created

    B

    Two objects are created

    C

    Three objects are created

    D

    One reference variable is created

    E

    Two reference variables are created

    F

    Three reference variables are created.


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

  • 第21题:

    多选题
    In the Expression Editor panel of CRS Script Editor, why would you use the Java tab? ()
    A

    to execute a specified method of a Java class

    B

    to reference a variable or invoke a method of a custom Java Object

    C

    to pass variables between two different workflows

    D

    to create an object for the purpose of executing methods on a remote computer

    E

    to get a reference to the Contact and Session states

    F

    to allow for arguments to be passed to a specified method


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

  • 第22题:

    单选题
    To make audit information more productive, the DBA executes the following command before startingan audit operation:  SQL> ALTER SYSTEM SET AUDIT_TRAIL=DB,EXTENDED SCOPE=SPFILE;  Which statement is true regarding the audit record generated when auditing starts after restarting thedatabase()
    A

    It contains only the plan for the SQL statement executed by the user.

    B

    It contains the SQL text executed by the user and the bind variables used with it.

    C

    It contains the plan and statistics associated with the SQL statement executed by the user.

    D

    It contains the plan for the SQL statement executed by the user and the bind variables used with it.


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

  • 第23题:

    多选题
    Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()
    A

    It can be invoked only from the doGet or doPost methods.

    B

    It can be used independently of the getRemoteUser method.

    C

    Can return true even when its argument is NOT defined as a valid role name in the deployment descriptor.

    D

    Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.


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