हेलो दोस्तों तो आज हम OOPS in Hindi (Object-oriented programming) के बारे में जानेंगे। और हम इसकी characteristics को भी हम आसान भाषा में समझेंगे तो चलिए शुरू करते है।
What is OOPS in Hindi – OOPS क्या होती है –
OOPS का full form (Object-Oriented Programming) होता है OOPS में हम प्रोग्राम को हमेशा Class और Objects का use करके बनाते है।
- OOPS एक ऐसी approach होती है जो data और functions के लिए अलग – अलग memory area create करती है जिसे template के रूप में उपयोग किया जा सकता है। ताकि जरुरत पढ़ने पर उन modules की copies बनायी जा सके।
- इसलिए एक object को computer memory का partitioned area माना जाता है जो data और operations या (Functions) को store करता है जो उस data को access कर सकते है। क्योकि यह memory partitions independent होते है objects को अलग – अलग program में बिना किसी modification के उपयोग किया जा सकता है।
- Object – oriented programming एक practical और useful programming methodology है जो modular design और software reuse को promote करती है। OOPS data को program development का एक important हिस्सा मानता है।
- Object – oriented programming में program को छोटी – छोटी entities में तोडा (divide) किया जाता है जिन्हे objects के around data और functions को बनाया (build) किया जाता है।
What is Class in OOPS in Hindi – OOPS में Class क्या होती है ?
Class similar type के objects का एक collection होती है ये class type के variable होते है जब एक class को define कर दिया जाता है तो हम उस class के multiple objects को create कर सकते है। हर objects उस class के data के साथ associated होता है जिससे वो create किया गया है। class एक user-defined data type होती है।
Example के लिए – मान लो एक Animal नाम की class है जो common properties (name, age, species) और common behaviours(eat, sleep, make_sound) define करती है dog, cat , lion, तीन अलग – अलग objects है जो class के द्वारा बनाये गए है हर objects का अपना अलग name और age है, लेकिन सबके पास same फंक्शन्स (behavior) available है।
What is Object in OOPS in Hindi – OOPS में ऑब्जेक्ट्स क्या होते है ?
Objects object – oriented system के basic entity होते है ये किसी person, place, bank account, data table या किसी भी item को represent कर सकते है जिसे प्रोग्राम को handle करना होता है। ये user-defined data जैसे vectors, time और lists को भी represent कर सकते है।Programming problem को objects के term में analyze किया जाता है, और उनके बीच होने वाली communication का nature भी समझा जा सकता है।
OOPS में जब एक प्रोग्राम execute होता, तो objects आपस में message send कर interact करते है । Example के लिए – customer object एक bank account को message send कर सकता है bank balance request करने के लिए । हर ऑब्जेक्ट के पास अपना डाटा होता है, और उस डाटा को हैंडल करने के लिए कोड भी होता है। ऑब्जेक्ट्स आपस में interact कर सकते है बिना ये जाने की दुसरे ऑब्जेक्ट का डाटा या कोड exactly कैसे काम करता है।
Example of OOPS – Java Program
// Car class define ki gayi hai
class Car {
String brand;
String color;
// Constructor
Car(String brand, String color) {
this.brand = brand;
this.color = color;
}
// start method
void start() {
System.out.println(color + " " + brand + " car start ho gayi hai.");
}
// Main method
public static void main(String[] args) {
// Car class ke objects banaye gaye hain
Car car1 = new Car("Toyota", "Red");
Car car2 = new Car("Honda", "Black");
car1.start();
car2.start();
}
}
Output –
Characteristics of OOPS in Hindi –
Object-oriented Programming के जनरल characteristics कुछ इस तरह है –
- oops (object-oriented programming) में data पर focus किया जाता है ना कि procedures पर।
- oops में Data Structure को इस तरह Design किया जाता है जिससे वो objects को properly represent कर सके।
- oops में जो functions किसी objects के data पर काम करते है, उन्हें उसी Data Structure के साथ जोड़ दिया जाता है।
- oops में data को hide किया जाता है और उसे external functions access नहीं कर सकते।
- oops में objects आपस में communication कर सकते फंक्शन्स कि help से।
- oops में जरुरत होने पर डाटा और फंक्शन्स को easily ऐड किया जा सकता है।
- oops में program को design करने में bottom-up approach को follow किया जाता है।
- oops में program को ऐसे parts में divide किया जाता है जिसे Objects कहते है।
तो दोस्तों इसी तरह के notes को पड़ने के लिए visit कर सकते है HindiCoder Website को।
Pingback: Master java in hindi and Discover 9 Exciting features and Eg