Why do object-oriented programmers usually specify that their data fields will have private access?
What will be an ideal response?
In object-oriented design, usually you do not want any outside programs or methods to alter your class's data fields unless you have control over the process. For example, you might design a class that performs a complicated statistical analysis on some data and stores the result. You would not want others to be able to alter your carefully crafted result. As another example, you might design a class from which others can create an innovative and useful GUI screen object. In this case you would not want others altering the dimensions of your artistic design.
To prevent outsiders from changing your data fields in ways you do not endorse, you force other programs and methods to use a method that is part of the class.
You might also like to view...
Stylesin the List Tables section include visible vertical borders between the columns.?
Answer the following statement true (T) or false (F)
Clip art is inserted through the Clip Art task pane
Indicate whether the statement is true or false
Case EX 5-2Sam is using the functions within Excel to complete questions in a school homework assignment.Sam needs to find the average of a range of numbers. What would be an example of a formula written correctly?
A. =AVG(E4,E9) B. =AVERAGE(E4:E9) C. =AVG(E4:E9) D. +AVERAGE(E4:E9)
Multi-factor authentication means users must authenticate with more than one device.
Answer the following statement true (T) or false (F)