what is Difference between Struct and Class

  • Struct are Value type and are stored on stack, while Class are Reference type and are stored on heap.
  • Struct “do not support” inheritance, while class supports inheritance. However struct can implements interface.
  • Struct should be used when you want to use a small data structure, while Class is better choice for complex data structure.

Comments

Popular posts from this blog

How do I calculate a MD5 hash from a string?

What is WSDL?