When writing a constructor how do you decide whether to use an initializer versus the set method to give initial values to the values of a class’s data members>

What will be an ideal response?


Use an initializer if the value of the data members has no restrictions. Use a set method if the value of the data member needs validation. Alternatively you could have the constructor perform its own validation.

Computer Science & Information Technology

You might also like to view...

A contact group is also called a(n) ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The default scheduler in TinyOS is a simple __________ queue.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

When picking additional sources you should choose

a. independent sources b. sources created by the same author c. sources with the same domain name d. additional sources are never needed

Computer Science & Information Technology

Named ____ hold values that do not change during a program's execution.

A. constants B. variables C. objects D. items

Computer Science & Information Technology