Update classes.md

pull/442/head
Kaza.Sunitha 2024-05-19 10:47:02 +05:30 zatwierdzone przez GitHub
rodzic 406227a4ad
commit 937f62905b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 3 dodań i 10 usunięć

Wyświetl plik

@ -204,15 +204,8 @@ class Derived(Base):
# Driver code
obj1 = Base()
print(obj1.a)
# Uncommenting print(obj1.c) will
# raise an AttributeError
# Uncommenting obj2 = Derived() will
# also raise an AttributeError as
# private member of base class
# is called inside derived class
# output
It will raises error because private members cannot be used outside the class even not for derived classes
**Inheritence**
->Inheritance allows us to define a class that inherits all the methods and properties from another class.
@ -452,4 +445,4 @@ Ostriches cannot fly.