7.Class va Constructor
asilbek ibragimov
Posted on October 11, 2024
7.Class va Constructor
a) Cunstructor nima?
b) Quyidagi kodni to'ldiring:
class Animal
{
public string Name;
public Animal(______)
{
Name = name;
}
}
Animal dog = new Animal("Dog");
Console.WriteLine(dog.Name);
** Test Javoblari**
a) Constructor — bu sinfning birinchi marta foydalanilganda avtomatik ravishda chaqiriladigan konstruktor. U faqat bir marta chaqiriladi va odatda sinfning statik a'zolarini boshlash uchun ishlatiladi.
b) Javob: "name" ;
💖 💪 🙅 🚩
asilbek ibragimov
Posted on October 11, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.