Unformatted text preview: ID: ___________
Name: _____________________ ICS 313-03 (021)
Quiz # 2
6 Nov, 2002 Q. 1 [5 points]:
Dynamic type binding is closely related to implicit heap-dynamic variables. Explain this relationship.
Implicit heap-dynamic variables acquire types only when assigned values, which must be at runtime.
Therefore, these variables are always dynamically bound to types.
Q. 2 [5 points]:
Define lifetime, scope, static scope, and dynamic scope.
The lifetime of a variable is the time during which the variables is bound to a specific memory
The scope of a variable is the range of statements over which it is visible
Static Scoping is based on program text
Dynamic Scoping is based on calling sequences of program units, not their textual layout
Q. 3 [5 points]:
Define the three sting length options.
Limited Dynamic Length
Dynamic Q. 4 [5 points]:
What are the differences between C++ and Java reference variables?.
C++ Reference Types
Constant pointers that are implicitly dereferenced
Used for parameters
Advantages of both pass-by-reference and pass-by-value
Java - Only references
No pointer arithmetic
Can only point at objects
No explicit deallocator
Dereferencing is always implicit ...
View Full Document
- Spring '07
- dynamic type binding, Java reference variables, sting length options, Limited Dynamic Length