DEV Community

Sabrina
Sabrina

Posted on

Class Object

a) C# da class nima?

Javob : Class - ma'lumotlar to'plami,ya'niy methods,properties.Class object uchun shablondir.

b) Object nima?

JaVob : Object - Classdan yaratilgan konkret nusxadir.

c)Quyidagi kodni natijasi : Tesla

class Car
{
    public string Model;
    public Car(string model)
    {
        Model = model;
    }

}
class Program
{
    static void Main()
    {
Car myCar = new Car("Tesla");
Console.WriteLine(myCar.Model);
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
asilbek_ibragimov_a0c27cc profile image
asilbek ibragimov

бомапти ееее фуууу👎🏾👎🏾

Collapse
 
sabrina_abcdna123 profile image
Sabrina

suiiiiiiiii