This video provides an introduction to the object-oriented programming, including an overview of Python syntax and how it differs from a language like Java. This include concepts like classes, objects, instance/static variable/methods, constructor, inheritance, abstraction, encapsulation, polymorphism.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Chapters
00:00 Intro
00:14 Class, Object, Variable, Methods, Constructor
05:18 Method Overloading
06:48 Inheritance
09:05 Polymorphism & Duck Typing
11:06 Abstraction
13:08 Encapsulation
16:53 Outro
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Notes:-
1.) To create empty class – use pass keyword.
2.) For static method, you don’t need to pass self as parameter as there is no instance. Also, use the @staticmethod annotation.
3.) To create objects, new operator is not required unlike in Java.
4.) For all the instance methods, you need self as the first parameter but for static methods, you don’t really need self at all.
5.) In Python ( Class level variable = static variable ) . To access this variable, access it via class name. If you want to refer any of the instance variable, you should always refer by self.variable_name.
6.) In Python, object class name starting with ‘o’ instead of ‘O’.
7.) In java, you need to define an instance variable and only then you can set a value to it. But in python you can see that’s not necessary. You can dynamically add attributes at runtime.
8.) In Python, there is no concept of constructor or method overloading. When python sees a method which has the same name as an earlier method, what it does that it removes the first method completely. It acts as if this method doesn’t really exists at all. Same is the case for constructor.
9.) For creating an abstract class, you need to extend ABC ( abstract base class). Inside an abstract class you have abstract method and you would indicate them by @abstractmethod. We need to import a module called “abc” and import ABC and abstractmethod.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
If you liked the video Please Do Subscribe My Channel 😉😇🙏
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Thank you for Watching!
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
In questa pagina del sito puoi guardare il video online Java Code to Python | OOPS della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Vibhor Gupta 24 giugno 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 334 volte e gli è piaciuto 21 spettatori. Buona visione!