Which among the following is an advantage of using classes over structures of C?

Which among the following is an advantage of using classes over structures of C?
A. Functions are restricted
B. Functions can’t be defined
C. Functions can also be encapsulated
D. Functions can have more security
 
Answer: c
Explanation: The functions are also made easy to be encapsulated inside a class. In structures, only the data members were allowed to be encapsulated. Hence classes can represent an entity in a better way.
 

Tìm kiếm

Back
Top