Back to Browse

OOPs in Python - Inner Class - Python in Tamil

378 views
Feb 2, 2022
10:17

Inner or Nested Class is defined inside another class. Grouping of two or more classes. Suppose you have two classes Car and Engine. Every Car needs an Engine. But, Engine won't be used without a Car. So, you make the Engine an inner class to the Car. It helps save code. Hiding code is another use of Nested classes. You can hide the Nested classes from the outside world. It's easy to understand the classes. Classes are closely related here. You don't have to search for the classes in the code. They are all together. Inner or Nested classes are not the most commonly used feature in Python. But, it can be a good feature to implement code. The code is straightforward to organize when you use the inner or nested classes. You can access the inner class in the outer class using the self keyword. So, you can quickly create an instance of the inner class and perform operations in the outer class as you see fit. You can't, however, access the outer class in an inner class. You can have more than one inner class in a class.

Download

1 formats

Video Formats

360pmp413.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

OOPs in Python - Inner Class - Python in Tamil | NatokHD