4102 Chapter 7
____ binding occurs during execution a. Rapid b. Static c. Value d. Dynamic
Dynamic
Declarations in surrounding blocks are called nonlocal declarations. T/F
False
If an operator can be used to perform more than one operation, it is said to be shadowed. T/F
False
In C++, declarations that bind all potential attributes are called prototypes. T/F
False
Java requires manual deallocation of objects. T/F
False
Java uses assignment by cloning for all object variables. T/F
False
Lexical scoping rules are sometimes called dynamic scoping. T/F
False
Static binding occurs during execution. T/F
False
Static constants are always computed at load time. T/F
False
The declaration before use scoping rule in C allows any declaration to be used as long as it is declared within the current block. T/F
False
The meaning of a name cannot be determined by the attributes associated with it. T/F
False
____ are generally bound at load time. a. All variables b. All attributes c. Predefined identifiers d. Global variables
Global variables
____ declarations are associated with a specific block. a. Local b. General c. Global d. Specific
Local
A block consists of a sequence of declarations followed by a sequence of statements. T/F
True
A fundamental abstraction mechanism in any programming language is the use of names, or identifiers to denote language entities or constructs. T/F
True
A translator's symbol table stores the mappings between names and attributes. T/F
True
Any scoping structure that can be referenced directly in a language must have its own symbol table. T/F
True
Binding time refers to when an attribute is computed and bound to a name. T/F
True
Dangling references are locations that have been deallocated from the environment but can still be accessed by a program. T/F
True
Declaration visibility includes only those regions of a program where the bindings of the declaration apply. T/F
True
Each function call generates a region of allocated memory associated with the function; this is called an activation record. T/F
True
In C, blocks are called compound statements. T/F
True
In a block-structured language with heap allocation, there are three kinds of allocation: static (for global variables), automatic (for local variables), and dynamic (for heap allocation). T/F
True
Locations are places where values can be stored. T/F
True
Names can be bound to attributes prior to translation time, as in the case of predefined identifiers. T/F
True
Names can be reused within nested blocks by associating each declaration with a level number and an offset. T/F
True
The lifetime of an object is the duration of its allocation in the environment. T/F
True
When a nonlocal name is used in an expression, the declaration that applies to that name cannot be determined until execution time under dynamic scoping. T/F
True
____ are any storable quantities, such as integers. a. Values b. Identifiers c. Data d. Locations
Values
A pointer is an object whose stored value is a ____. a. activation record b. direction c. compound value d. reference to another object
a. reference to another object
Each call to a method is referred to as a ____. a. activation b. branching c. execution d. invocation
activation
In C, the ____ operator retrieves the address of a variable as a pointer. a. dereference b. allocation c. address of d. reference
address of
A ____ occurs when the same object is bound to two different names at the same time. a. duplicate b. multi-reference c. alias d. conflict
alias
In object-oriented languages such as Java and Smalltalk, the ____ is the only declaration that does not itself need to be inside another class declaration. a. file b. module c. package d. class
class
Assignment by sharing works by ____. a. accessing shared memory b. duplicating memory addresses c. copying the location of the first variable to the second d. copying the value to a new location
copying the location of the first variable to the second
In C++, declarations that bind all potential attributes are called ____. a. symbols b. prototypes c. explicits d. definitions
definitions
The bindings of names to storage locations is called the ____. a. environment b. compiler c. symbol table d. translator
environment
Language systems that automatically reclaim garbage are said to perform ____. a. recycling b. garbage collection c. memory reallocation d. memory reclamation
garbage collection
In C, the scope of a binding is limited to the block in which its associated declaration appears. This scoping rule is called ____ scope. a. lexical b. block c. package d. namespace
lexical
The ____ is the level number and offset of a declared name. a. lexical address b. explicit address c. compound address d. block address
lexical address
The body of an externally defined function will not be bound until ____. a. load time b. link time c. translation time d. execution time
link time
A ____ constant is a name for a literal. a. manifest b. static c. compile-time d. symbolic
manifest
Garbage is defined as ____. a. variables with duplicate values b. a collection of unused variables c. memory that has been allocated in the environment but that has become inaccessible to the program d. a collection of unused constants
memory that has been allocated in the environment but that has become inaccessible to the program
Dynamic allocation places variables ____. a. on the heap b. in the pointer list c. on the stack d. in the symbol table
on the heap
If an operator performs more than one function it is said to be ____. a. shadowed b. implicit c. overloaded d. variable
overloaded
A variable declared locally within a block is said to ____ a global variable of the same name. a. shadow b. mirror c. occlude d. override
shadow
When a change in the value of a variable persists beyond the execution of a statement, a ____ has occurred. a. error b. side effect c. compound change d. persistent effect
side effect
The scope of a binding is ____. a. the region over which the binding is maintained b. the precision of the binding c. the magnitude of the binding d. the time when the binding takes place
the region over which the binding is maintained
The bindings of ____ to storage locations is called the memory. a. names b. attributes c. values d. identifiers
values
A ____ is an object whose stored value can change during execution. a. method b. variable c. pointer d. class
variable