user image

Preeti Tripathi

Job Interview Skills
English
2 years ago

Question 262. Similarities And Difference Between Class And Structure In .net

user image

Abhishek Mishra

2 years ago

Similarities: Both Class and Structures can have methods, variables and objects. Both can have constructor. Both are user defined types. Differences: Structure being value type, the variables cannot be assigned to NULL. On the other hand, classes being reference type, a class variable can be assigned to NULL. Structure is allocated on a stack when instantiated, while Class is allocated on a heap.

Recent Doubts

Close [x]