Pankaj Pathak
What is difference between an Structure and Class?
By Pankaj Pathak in C# on Jun 11 2013
  • Kundan Kumar
    Jun, 2013 13

    Class and Structure are syntactically same but there are few differences: 1. We can Not declare a constructor with no parameter (default constructor) for Structure, but can declare for Class. 2. In structure we can not initialize instance fields at their time of declaration, but in class we can do. Ex: sturct stuct1 {private int a = 0; // compile time error }class class1 {private int a = 0; // compile without error. }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS