Class
A user-defined data structure that groups properties and methods. Class doesn’t occupies memory.
Object
Instance of Class is called object. An object is created in memory using keyword “new”.
Encapsulation
Wrapping up of data and function into a single unit is known as Encapsulation.
Properties
Attribute of object is called properties. Eg1:- A car has color as property.
Eg2:
private string m_Color;;
public string Color
{
get
{
return m_Color;
}
set
{
m_Color = value;
}
}
Car Maruti = new Car();
Maruti.Color= “White”;
Console.Write(Maruti.Color);
No comments:
Post a Comment