Why do we need structs in c#?



Why do we need structs in c#?..

Answer / Rahul Chakraborty

Structs (structures) are value types in C#. They provide a lightweight alternative to classes and are particularly useful for small, simple data containers like numbers, dates, and custom data structures that don't require inheritance or garbage collection.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

in a town the percentage of total men is 52. the percentage of total literacy is 48. if total percentage of literate men is 35 of total population. write a program to find out the total no of illiterate men and women.

3 Answers   HCL,


What is c# used for?

1 Answers  


how encapsulation is implemented in c#

1 Answers   Cognizant,


How to implement singleton design pattern in c#?

1 Answers  


What is a method signature?

1 Answers  


Explain constructor?

6 Answers   Wipro,


Explain how to implement an object pool in c#.net

1 Answers  


How will U encapsulate button trigger event into text_box event of Pressing Enter key?

3 Answers   TCS,


What is a dll in c#?

1 Answers  


What is the use of regex in c#?

1 Answers  


How will you get the different language strings?

1 Answers  


Is string mutable in c#?

1 Answers  


Categories