DEV Community

Firdavs Mukhsimov
Firdavs Mukhsimov

Posted on

Class va Object

a)C# da class nima?

a)Bu ma'lumotlar va xatti-harakatlar sinf ichida aniqlanadi va sinfdan 
yaratilgan har bir ob'ekt uchun alohida bo'ladi.
Enter fullscreen mode Exit fullscreen mode

b)Object nima?

b)Ob'ekt-bu singdan yaratilgan konkret nusxadir.Ob'ekt orqali sinfda aniqlangan 
Enter fullscreen mode Exit fullscreen mode

c)Quydagi kodning natijasini ayting:

class Car
{
    public string Model;
    public Car(string model)
    {
      Model = model;
    }
}
Car myCar = new Car ("Tesla") ;
Console. WriteLine(myCar.Model) ;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)