Introduction to OOPs in Java in Hindi ??? ??????????????? ?????? ???????????????????????? ?????? ???????????? ????????????
?????????????????? ?????????????????????, ??????????????? Java Programming ??????????????? ????????? ???????????? ????????????-???????????? ?????????????????? ????????? ?????? ?????? ???????????? Java ?????? ??????????????? ????????????????????????????????? (Variables, Loops, Methods) ????????? ????????? ???????????? ?????? ?????? Java ?????? "?????????" ?????? ????????? ????????????????????? ?????? ?????????, ?????? ?????? ???????????? ?????? ????????? ????????? ??? OOPs in Java in Hindi???
?????? ????????? ??????????????? ???????????? ?????? ???????????????????????? ?????? ???????????? ?????????, ?????????????????? ???????????? ?????? ?????? ?????? ???????????? ????????????????????? ????????? ??????????????? ???????????? ???????????????, ?????? ?????????????????? ?????? ???????????? ???????????? ?????? ????????????????????? ?????????????????? ????????? ?????? ?????? Class ?????? Object ?????? "????????? ????????????????????????" ?????? ?????????????????? ?????? ????????????????????????
What is OOPs in Java in Hindi? ??? ???????????? ????????? OOPs ???????????? ???????
OOPs ?????? ???????????? ????????? Object Oriented Programming System ?????????
???????????? ?????? ?????????????????? (???????????? C) "?????????" (Procedure) ?????? ???????????? ???????????? ???????????? ??????????????? Java "???????????????" (Object) ?????? ???????????? ???????????? ?????????
OOPs ?????? ??????????????? ???????????????????????? ?????????????????? ?????? Real World (???????????? ??????????????????) ???????????? ??????????????? ????????? ???????????? ???????????? ?????????????????? ????????? ?????? ????????? ?????? "????????????????????????" ?????? (?????????, ??????????????????, ?????????, ???????????????), ???????????? ?????? ?????????????????? ????????? ?????? ?????? ?????? ????????? ?????? ???????????????????????? ??????????????? ????????????
The Car Factory Analogy (???????????? ???????????????)
Class ?????? Object ?????? ???????????? ?????? ??????????????? ?????? ????????? ?????? ????????? ???????????????????????? ?????? ???????????? ????????? ??????????????????:
- Blueprint (???????????????): ????????? ??????????????? ?????? ???????????? ???????????????????????? ???????????? ?????? ???????????? ?????????????????? ??????????????? ????????? ?????? ???????????? ?????? ????????? ?????? ????????????, ????????????, ????????? ?????? ???????????? ???????????? ????????? ???????????? ?????? ?????? ???????????? ?????? ????????? ???????????? ?????????? ??????????????? ?????? ??????????????? ?????? ??????????????? ????????? ????????? ?????? Class ???????????? ????????????
- Real Car (???????????? ?????????): ?????? ??????????????? (Class) ?????? ??????????????? ???????????????????????? ????????? ?????? ???????????? ????????? ???????????? ??????, ???????????? ?????? ?????? ???????????? ????????? ?????? ????????? ???????????? ?????????, ????????? Object ???????????? ????????????
???????????????: ?????? ??????????????? (Class) ?????? ?????? ?????????????????? ??????????????? (Objects) ????????? ???????????? ????????????
What is Class in Java in Hindi? - ???????????? ????????? ??????????????? ???????????? ???????
Class ?????? Blueprint ?????? Template ?????????
- ?????? ?????? "??????????????????" ????????? ?????? (?????? ?????????????????? ????????? ????????? ???????????? ????????????)???
- ??????????????? ?????? ???????????? ???????????? ?????? ?????? ???????????????????????? ???????????? ?????????????????? ?????? ???????????? ????????? ??????????????????
- Example: 'Car', 'Dog', 'Student' ?????? ?????? ??????????????? ????????????
What is Object in Java in Hindi? - ???????????? ????????? ???????????????????????? ???????????? ???????
Object ??????????????? ?????? ?????? Instance (??????????????????) ?????????
- ?????? ?????? "??????????????????" ????????? ?????? (?????? ???????????????????????? ?????? ?????????????????? ????????? ????????? ???????????? ??????)???
- ?????? ??????????????? ?????? ??????????????? ?????? ????????? ???????????? ???????????????????????? ?????????
- Example: 'Audi' (Car ??????????????? ?????? ????????????????????????), 'Tommy' (Dog ??????????????? ?????? ????????????????????????)???
4 Pillars of OOPs in Java in Hindi - ???????????? ????????? OOPs ?????? 4 ??????????????????
OOPs ???????????? ????????? ?????? ?????? 4 ?????????????????? ?????? ???????????? ????????? ?????? (?????????????????? ?????? ????????? ???????????? ????????????????????? ????????? ????????????????????? ?????? ??????????????????):
- Inheritance: ???????????? ?????? ????????? ???????????? ????????? ????????????
- Polymorphism: ?????? ???????????????, ?????? ????????????
- Encapsulation: ????????????????????? ????????? ???????????? ????????? ???????????? (???????????? ?????????????????????)???
- Abstraction: ??????????????? ????????? ?????? ????????? ?????????????????? (???????????? ????????? ?????? ???????????????????????????, ???????????? ????????????)???
Java Class and Object Code Example
???????????? ?????? ????????? ??????????????? ??????????????? ???????????? ?????? ?????? Car ??????????????? ????????????????????? ?????? ????????? ???????????? ???????????????????????????
// Class (Blueprint)
class Car {
String color = "Red";
String model = "Sedan";
void drive() {
System.out.println("Car is driving...");
}
}
// Main Class
public class Main {
public static void main(String[] args) {
Car myCar = new Car();
System.out.println("Color: " + myCar.color);
System.out.println("Model: " + myCar.model);
myCar.drive();
}
}
Output:
Color: Red
Car is driving...
Conclusion ??? ????????????????????????
???????????? ?????????????????? ?????? ?????? ?????? ??????????????? ?????? ???????????? Introduction to OOPs in Java ????????? ???????????? ???????????????
????????? ????????????: Class ???????????? "???????????? ?????? ???????????????" ?????? Object ???????????? "???????????? ???????????????"???
???????????? ??????????????? ????????? ?????? OOPs ?????? ???????????? ???????????? "Inheritance in Java" ?????? ???????????? ????????? ??????????????????, ???????????? ?????? ????????????????????? ?????? ???????????? ?????? ??????????????? ??????????????? ??????????????? ?????? ????????? ?????? "????????????" ?????? ???????????? ?????????
FAQs
Q1. ???????????? ?????? Class ?????? ???????????? Java ??????????????????????????? ????????? ???????????? ??????????
Ans: ????????????, Java ???????????? ????????? ?????? Object Oriented ??????, ??????????????? ??????????????? ?????? ????????? Class ?????? ???????????? ?????? ??????????????? ???????????? ?????????
Q2. 'new' ?????????????????? ?????? ???????????? ????????? ???????
Ans: new ?????????????????? ?????? ???????????????????????? Object ??????????????? ?????? ????????? ???????????? ????????? ?????? ?????????????????? ????????? ???????????????????????? ?????? ????????? ????????? ??????????????? ?????????
Q3. Class ?????? Object ????????? ??????????????? ???????????? ???????????? ???????
Ans: Class ?????????????????? (RAM) ????????? ????????? ???????????? ????????????, ???????????? Object ?????????????????? ????????? ????????? ???????????? ?????????