Quiz%202_key - ID Name ICS 313-03(021 Quiz 2 Weight 4 6 Nov...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ID: ___________ Name: _____________________ ICS 313-03 (021) Quiz # 2 Weight 4% 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 location. 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. Static 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

{[ snackBarMessage ]}

Ask a homework question - tutors are online