Is Class is same as Structure and Union ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is Class is same as Structure and Union ?

26th Jul 2016, 2:50 PM
Sourav Kumar Samal
Sourav Kumar Samal - avatar
4 Answers
+ 2
kind of . but structures were originally created to store variables of different data types. Functions can also be added to them as the object oriented model allows. but they dont support Inheritance because they were not actually the intrest of object orinted model. A Class is more better than a structure coz it support OOP in encapsulation and Inheritance.
31st Jul 2016, 2:30 AM
Javeria Khan
0
Class is the same as structure
27th Jul 2016, 4:19 AM
Ben Cla
Ben Cla - avatar
0
inheritance
5th Aug 2016, 1:39 PM
Tammie Younger
Tammie Younger - avatar
0
No, a class has methods and store data. Structure is only for store data and Union is for multiple type data on one var.
14th Aug 2016, 11:06 AM
Miguel Martinez Bernal
Miguel Martinez Bernal - avatar