OOP Concepts In Java

 OOP Concepts :


                        - OOP Stands for Object Oriented Programming.

                        - It depends on class and object.

                        - It is a secure rather than POP(Procedure Oriented Programming)structure.

                        - Secure the code and data.

                     

Class : 
                        - Where the data and code are bound together in a single unit is called class.

                        - Class used access specifier for secure data.

Object : 

                        - Instance of class is called an object. 

                        - Object is used for access properties of class.


OOP have four pillars :

                                         - Inheritance

                                                             - Encapsulation

                                                             - Polymorphism

                                                             - Abstraction


                          (1) Inheritance : 

                                                     - The ability to one class derive into another class is called Inheritance.

                                                     - Reusability of code is also called Inheritance.


                       (2) Encapsulation :

                                                    - The ability to data hiding is called Encapsulation.

                                                    - Private / Abstract class

                    

                       (3) Polymorphism : 

                                                    - Same name and multiple forms are called Polymorphism.

                                                    - (i) Compile Time Polymorphism --> Overloading

                                                    - (ii) Run-Time Polymorphism --> Overriding    


                       (4) Abstraction :

                                                   - In OOP, abstraction is a concept that allows developers to create abstract classes and interfaces. 

                                                   - A class that at least one pure virtual function or abstract function is called Abstract class.

Comments