Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD

Part 19 - C# Tutorial - Introduction to classes

Part 19 - C# Tutorial - Introduction to classes


  1. I was looking for the answer of the question why classes are called user defined data type? Please define this.

    1. Not quite, but User-defined data types and classes can both contain multiple variables of different data types like combination of primitive data types (long, int,float etc) specified by the user. But unlike user-defined data types, classes can also contain procedures (properties and methods) that operate on those variables. Classes can be derived from existing classes called base class but User-defined data types cannot.

  2. code in a class is written by the user that's why we are calling it as user defined data type ...

  3. Hi Sir,
    As you are saying in constructor all fields got initialise with values.
    Then I am confused with declaration of variable and assigning value to it.

    Ex : private _str="pregim";

    if it will initilize in constructor then why system allowing me to do so.


If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.