Struct:: class Choices:
- Struct Composite data type
- Structs are only value type
- Classes are referenced type
- Struct uses stack , Class uses heap
- Struct : No garbage collection, starts and ends with the
clients calling the struct objects.
- Class : Garbage collection in place
- Structs can't inherit other structs or classes
- Sturct can't be a base class
- Struc does not support inheritance, members can't be specified
as abstract, virtual or protected
- Use of new to create an object is your choice to create specific
constructors , and initialize this object manually.
|