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.
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.
Hi sir i am new in c# and your videos helping for me thank you. and this session i was practice it will be show error code can resolve- "CS5001 C# Program does not contain a static 'Main' method suitable for an entry point"
I was looking for the answer of the question why classes are called user defined data type? Please define this.
ReplyDeletethnx.
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.
Deletecode in a class is written by the user that's why we are calling it as user defined data type ...
ReplyDeleteHi Sir,
ReplyDeleteAs 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.
Hi sir i am new in c# and your videos helping for me thank you. and this session i was practice it will be show error code can resolve-
ReplyDelete"CS5001 C# Program does not contain a static 'Main' method suitable for an entry point"
if you debug the program error is automatically gone.i think this is helpfull for you
Delete