Science, asked by hemansh2501, 1 year ago

Difference between class and structure in oops

Answers

Answered by tanu23081
1
Structure is a value type that is why its object is created on Stack memory.Structure does not support the inheritance and cannot inherit anotherclass. Structure can only have the parametrized constructor. it means astructure can not have the non-parametrized constructor,default constructor and destructor also.
Answered by SohamKundu012
0

OOP uses data abstraction , encapsulation , and hence protects data .

POP does not have a good system of data security .

OOP gives equal stress on data and functions .

POP lays more stress on functions rather than data .

Hence OOP is better than POP.

Similar questions