DEV Community

Sunnat Qayumov
Sunnat Qayumov

Posted on

8. Object-Oriented Programming(OOP)

a) Encapsulation nima?

Uning tuzilishini (ma'lumotlarini) 
va xatti-harakatlarini (usullarini) belgilaydigan
abstraktsiya elementlarini ajratish jarayoni
Enter fullscreen mode Exit fullscreen mode

b) Inheritance nima?

Bizga kodni qayta ishlatish va mavjud sinflardan 
xususiyatlar va xatti-harakatlarni meros qilib oladigan 
yangi sinflarni yaratish imkonini beradi.
Enter fullscreen mode Exit fullscreen mode

c)Polymorphism nima? Misol keltiring.

class Algebra
{
    public int Add(int a, int b)
    {
        return a + b;
    }
    public int Add(int a, int b, int c)
    {
        return a + b + c;
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)