InterviewSolution
| 1. |
Write About The Role Of C++ In The Tradeoff Of Safety Vs. Usability? |
|
Answer» Earlier in C, an encapsulation is achieved by MAKING the methods static in a class. On the contrary, in C++, it would not work. Programmers USE structs in C for making multiple instances. The creation of multiple instances is not supported directly by the data with static keyword in a class. This situation made the concept of tradeoff between safety (information hiding) and usability (multiple instances) WORSE. Earlier in C, an encapsulation is achieved by making the methods static in a class. On the contrary, in C++, it would not work. Programmers use structs in C for making multiple instances. The creation of multiple instances is not supported directly by the data with static keyword in a class. This situation made the concept of tradeoff between safety (information hiding) and usability (multiple instances) worse. |
|