volume_mute

A variable can dynamically bind to

publish date2022/09/04 12:28:00 GMT+10

volume_mute
a type value in an assignment statement
different type values during program execution
a temporary type value
a memory cell

Correct Answer

(1) a type value in an assignment statement
(2) different type values during program execution
(3) a temporary type value
(4) a memory cell

Explanation

With dynamic type binding, the type of a variable is not specified by a declaration statement, nor can it be determined by the spelling of its name. Instead, the variable is bound to a type when it is assigned a value in an assignment statement. When the assignment statement is executed, the variable being assigned is bound to the type of the value of the expression on the right side of the assignment. Such an assignment may also bind the variable to an address and a memory cell, because different type values may require different amounts of storage. Any variable can be assigned any type value. Furthermore, a variable’s type can change any number of times during program execution. It is important to realize that the type of a variable whose type is dynamically bound may be temporary.

Reference

Concepts of Programming languages, 10th ed


Quizzes you can take where this question appears