ITCS-4102 Programming Languages Quiz 7
____ binding occurs during execution.
Dynamic
Declarations in surrounding blocks are called nonlocal declarations.
False
If an operator can be used to perform more than one operation, it is said to be shadowed.
False
In C++, declarations that bind all potential attributes are called prototypes.
False
Java requires manual deallocation of objects.
False
Java uses assignment by cloning for all object variables.
False
Lexical scoping rules are sometimes called dynamic scoping.
False
Static binding occurs during execution.
False
Static constants are always computed at load time.
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.
False
The meaning of a name cannot be determined by the attributes associated with it.
False
____ are generally bound at load time.
Global variables
____ declarations are associated with a specific block.
Local
A block consists of a sequence of declarations followed by a sequence of statements.
True
A fundamental abstraction mechanism in any programming language is the use of names, or identifiers to denote language entities or constructs.
True
A translator's symbol table stores the mappings between names and attributes.
True
Any scoping structure that can be referenced directly in a language must have its own symbol table.
True
Binding time refers to when an attribute is computed and bound to a name.
True
Dangling references are locations that have been deallocated from the environment but can still be accessed by a program.
True
Declaration visibility includes only those regions of a program where the bindings of the declaration apply.
True
Each function call generates a region of allocated memory associated with the function; this is called an activation record.
True
In C, blocks are called compound statements.
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).
True
Locations are places where values can be stored.
True
Names can be bound to attributes prior to translation time, as in the case of predefined identifiers.
True
Names can be reused within nested blocks by associating each declaration with a level number and an offset.
True
The lifetime of an object is the duration of its allocation in the environment.
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.
True
____ are any storable quantities, such as integers.
Values
A pointer is an object whose stored value is a ____.
a. reference to another object
Each call to a method is referred to as a ____.
activation
In C, the ____ operator retrieves the address of a variable as a pointer.
address of
A ____ occurs when the same object is bound to two different names at the same time.
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.
class
Assignment by sharing works by ____.
copying the location of the first variable to the second
In C++, declarations that bind all potential attributes are called ____.
definitions
The bindings of names to storage locations is called the ____.
environment
Language systems that automatically reclaim garbage are said to perform ____.
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.
lexical
The ____ is the level number and offset of a declared name.
lexical address
The body of an externally defined function will not be bound until ____.
link time
A ____ constant is a name for a literal.
manifest
Garbage is defined as ____.
memory that has been allocated in the environment but that has become inaccessible to the program
Dynamic allocation places variables ____.
on the heap
If an operator performs more than one function it is said to be ____.
overloaded
A variable declared locally within a block is said to ____ a global variable of the same name.
shadow
When a change in the value of a variable persists beyond the execution of a statement, a ____ has occurred.
side effect
The scope of a binding is ____.
the region over which the binding is maintained
The bindings of ____ to storage locations is called the memory.
values
A ____ is an object whose stored value can change during execution.
variable