|
| 1 | +# Java Tutorial: Introduction to Object Oriented Programming |
| 2 | +- Object-Oriented Programming tries to map code instructions with real-world, making the code short and easier to understand. |
| 3 | +- With the help of OOPs, we try to implement real-world entities such as object, inheritance, abstraction, etc. |
| 4 | +- OOPs helps us to follow the DRY(Don't Repeat Yourself) approach of programming, which in turn increases the reusability of the code. |
| 5 | + |
| 6 | +### Two most important aspects of OOPs - Classes & Objects : |
| 7 | + |
| 8 | +#### Class : |
| 9 | +- A class is a blueprint for creating objects. |
| 10 | +- Classes do not consume any space in the memory. |
| 11 | +- Objects inherit methods and variables from the class. |
| 12 | +- It is a logical component. |
| 13 | + |
| 14 | +<img src="https://api.codewithharry.com/media/videoSeriesFiles/courseFiles/java-tutorials-for-beginners-36/base64.png" alt=""> |
| 15 | + |
| 16 | +#### Objects : |
| 17 | +- An object is an instantiation of a class. When a class is defined, a template (info) is defined. |
| 18 | +- Every object has some address, and it occupies some space in the memory. |
| 19 | +- It is a physical entity. |
| 20 | +- Take a look at the below example to get a better understanding of objects and classes : |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +### How to model a problem in OOPs |
| 25 | +- We identify the following: |
| 26 | + |
| 27 | +``` |
| 28 | +Noun - Class - Employee |
| 29 | +Adjective - Attributes - name, age, salary |
| 30 | +Verb - Methods - getSalary(), increment() |
| 31 | +``` |
| 32 | + |
| 33 | +- This is all for this tutorial. We will do a detailed discussion on every aspect of OOPs in further tutorials. |
| 34 | + |
| 35 | +**Handwritten Notes: [Click to Download](https://api.codewithharry.com/media/videoSeriesFiles/courseFiles/java-tutorials-for-beginners-36/Ch8.pdf)** |
| 36 | + |
| 37 | +**Ultimate Java Cheatsheet: [Click To Download](https://api.codewithharry.com/media/videoSeriesFiles/courseFiles/java-tutorials-for-beginners-36/UltimateJavaCheatSheet.pdf)** |
0 commit comments