+ 2
we can create a class using structures??
6 Answers
+ 2
Not quite. You can create something ressembling a class at best.
+ 1
There is a keyword called (struct) it creates something similar to a class. I'm not sure if this is what you're asking about though.
+ 1
No. structure is different class is different.
0
yes.. v can
0
class Person {
var str = Man()
}
where Man is of type Structure
struct Man {
var a = 7
}
0
structures are sort of the base class of classes but no you cant use structs to make classes as structs cannot contain methods and are basically just boxes to hold variables in