Question: 1 . By making all the functions and variables public you expose the internal details of the class. This can lead to potential issues such
By making all the functions and variables public you expose the internal details of the class. This can lead to potential issues such as unauthorized access, making it difficult to change the code, and data corruption. It is beneficial to write the accessor and mutator methods because they allow you to control how the data is accessed and modified. Also because you can change the internal representation of the data without affecting the code that uses the class.
One situation I can think of where a public class would be preferable is in small projects where you can cut down on a lot of the extra code, making everything simpler and quicker to write and understand.
Text files are preferable when human readability is important. Binary files are preferable for efficiency and storing complex data structures like serialized objects. Random access files are most preferable when you need direct access to specific parts of a large file, like databases or large datasets. rewrite so it doesn't sound so ai
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
