Sunday, April 28, 2024
Java OOPs Concepts

Java OOPs Concepts:

  • Object-Oriented Programming एक paradigm है जो कई concepts provide करता है, जैसे inheritance, data binding, polymorphism, आदि।
  • Simula को पहली object-oriented programming language माना जाता है।
  • Smalltalk को पहली truly considered object-oriented programming language माना जाता है।
  • Popular object-oriented languages Java, C#, PHP, Python, C++, आदि हैं।

Object-Oriented Programming System(OOPs):

Object का मतलब एक real-world की entity है जैसे कि pen, chair, table, computer, watch, आदि। Object-Oriented Programming classes and objects का use करके program design करने के लिए एक methodology or paradigm है। यह कुछ concepts को provide करके software development and maintenance को simple बनाता है |

  1. Object
  2. Class
  3. Inheritance
  4. Polymorphism
  5. Abstraction
  6. Encapsulation

oops

1. Object:
किसी भी entity की state and behaviour एक object के रूप में जाना जाता है। example के लिए, एक chair, pen, table, keyboard, bike, आदि यह physical or logical हो सकता है।

एक object को एक class के instance के रूप में defined किया जा सकता है। एक object में एक address होता है और memory में कुछ space लेता है। Object एक-दूसरे के data or code का details जाने बिना communicate कर सकते हैं। केवल necessary thing accept किए गए message का type है और objects द्वारा response का type।

Example: एक dog एक object है क्योंकि इसमें colour, name, breed, आदि के साथ-साथ tail को wagging, barking, eating आदि जैसे behaviours हैं।

2. Class:
Objects के Collection को class कहा जाता है। यह एक logical entity है।

एक class को एक blueprint के रूप में भी define किया जा सकता है जिसमें से आप एक individual object बना सकते हैं। class किसी भी space को consume नहीं करती है।

3. Inheritance:
जब कोई object किसी मूल object के सभी properties and behaviours को प्राप्त कर लेती है, तो उसे inheritance के रूप में जाना जाता है। यह code reusability provide करता है। इसका use runtime polymorphism को प्राप्त करने के लिए किया जाता है।

4. Polymorphism:
यदि किसी task को different तरीकों से किया जाता है, तो इसे polymorphism के रूप में जाना जाता है। Example के लिए: customer को अलग ढंग से convince करने के लिए, कुछ आकर्षित करने के लिए, Example के लिए, shape, triangle, rectangle, आदि।

Java में, हम polymorphism को प्राप्त करने के लिए method overloading and method overriding का use करते हैं।

एक और Example कुछ बोलने के लिए हो सकता है; Example के लिए, एक cat म्याऊ बोलती है, dogs भौंकते हैं, आदि।

5. Abstraction:
internal details को hide और functionality दिखाना abstraction के रूप में जाना जाता है। Example के लिए phone call, हम internal processing नहीं जानते।

Java में, हम abstract class and interface का use abstraction प्राप्त करने के लिए करते हैं।

6. Encapsulation:
एक entity में Binding code and data को एक साथ encapsulation के रूप में जाना जाता है। Example के लिए, एक capsule, इसे different medicines के साथ wrapped जाता है।

एक java class encapsulation का example है। Java bean पूरी तरह से encapsulated class है क्योंकि यहां सभी data members private हैं।

Object Oriented Programming Language के निम्नलिखित Advantages हैं:-

  • इस method में Inheritance के द्वारा redundant code को remove जा सकता है एवं पहले से existing Classes के use को extend किया जा सकता है ।
  • Data Hiding का Concept programmers को secure programs बनाने में help करता है जिसे code द्वारा program के दूसरे भागों में use नहीं किया जा सकता है ।
  • OOP की techniques से एक Program को Quickly Operational हेतु Objects के parts के base पर अनेक parts में divide किया जा सकता है ।
  • इस technique से छोटे – छोटे Program के Combination द्वारा Large Program easily prepare किए जा सकते हैं |
  • इसके द्वारा कार्यरत level modules का संबंध easily level modules से हो जाता है , जिससेcode को बार – बार नहीं लिखना पड़ता है , जिसके कारण Program में समय की बचत होती ही है तथा Develop की ability में वृद्धि होती है ।
  • इस technique के द्वारा Object की Classes के साथ उनसे related Functions को भी integrated कर दिया जाता है , जिससे processing का कार्य easy and secure हो जाता है ।
  • Objects के बीच Communication के लिए message passing Method द्वारा External System के साथ interface करना interface होता है ।
  • इस programming के द्वारा Software complexity ( complexity ) को easily solve किया जा सकता है ।
  • Software develop करना easy होता है ।
Tags: , , , , , , ,
Avatar
My name is Yash Pogra and I am the chief blogger at Codeash and where I like to share my internet/tech experience with my online readers on this website. I have been a webmaster from 2015 which is when I had registered my first company by the name Codeash. I have ventured into different online businesses like offering SEO Services, website development services.

Related Article

No Related Article

1 Comment

Avatar
Avinash Sharma 09/11/2021 at 11:07 am

So much fantastic info on here, I am impressed with your creativity.Keep it up. Thanks for sharing this with us!

Leave a Comment