Which of the following is NOT true about variables?
A. Their values can change during execution.
B. Before using a variable for the first time, the program must declare its type.
C. The type of data a variable contains can be changed.
D. All of the above are true.
Answer: C
You might also like to view...
Explain how fit among the H CI elements of the human, the computer, and the tasks to be performed leads to performance and well-being.
What will be an ideal response?
Many programs written with inheritance could be solved with composition instead, and vice versa. Discuss the relative merits of these approaches in the context of the Point, Circle, Cylinder class hierarchy in this chapter. Rewrite the classes in Figs. 9.6–9.8 (and the supporting programs) to use composition rather than inheritance. After you do this, reassess the relative merits of the two
approaches both for the Point, Circle, Cylinder problem and for object-oriented programs in general. What will be an ideal response?