Object-Oriented Programming

asadbekit

Asadbek-IT

Posted on October 13, 2024

Object-Oriented Programming

Encapsulation bu ob'ektga yo'naltirilgan dasturlashda (OOP) asosiy tushunchadir.

Inheritance ob'ektga yo'naltirilgan dasturlashda (OOP) asosiy tushuncha bo'lib, bir sinfga boshqa sinfning xususiyatlari va usullarini meros qilib olish imkonini beradi.

Polymorphism - bu ob'ektga yo'naltirilgan dasturlashning asosiy kontseptsiyasi bo'lib, usullar bir xil nomga ega bo'lsa ham, u harakat qilayotgan ob'ekt asosida turli xil narsalarni qilish imkonini beradi.

class Animal
{
public virtual void MakeSound()
{
Console.WriteLine("Animal makes a sound");
}
}

class Dog : Animal
{
public override void MakeSound()
{
Console.WriteLine("Dog barks");
}
}

💖 💪 🙅 🚩
asadbekit
Asadbek-IT

Posted on October 13, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related