Skip to main content

Posts

Showing posts with the label Class

Classes and Objects In C#

Class  is a collection of fields, properties and methods. It depicts real life entities and is a fundamental concept in Object Oriented Programming.  A class is a user-defined blueprint  from which objects are created . A class is a user defined data type of  reference type. Lets take a example of a Car . It has different attributes like color,maximum speed,no of gears on with a built in audio player  and so on. public class Car {     private string  _color; //a variable and a field with data type string     // a variable and  a property       public string Color       {         get         {             return _color;         }         set         {             _color= value;       ...