What is Object-Oriented Programming (OOP)? What are the main principles of OOP? What is the difference between Method Overloading and Method Overriding?

Updated: 2 months ago
উত্তরঃ

Object-Oriented Programming (OOP):

Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data in the form of fields (often known as attributes or properties) and code in the form of procedures (often known as methods). OOP focuses on organizing software design around data or objects, rather than functions and logic, making complex programs more modular, reusable, flexible, and easier to maintain.

Main Principles of OOP:

The four main fundamental principles (pillars) of Object-Oriented Programming are:

      
  • Encapsulation: The practice of bundling data (variables) and the methods that operate on that data into a single unit or class, while restricting direct access to some of the object's components (data hiding) to prevent unintended modification.
  •   
  • Abstraction: The process of hiding internal implementation details and showing only the necessary and relevant features to the user. This reduces complexity and allows developers to focus on interaction rather than implementation.
  •   
  • Inheritance: A mechanism where a new class (child/subclass) derives properties and behaviors (methods) from an existing class (parent/superclass). It promotes code reusability and establishes a hierarchical relationship between classes.
  •   
  • Polymorphism: The ability of a method, object, or function to take on multiple forms. It allows one interface to be used for a general class of actions, with specific actions determined by the exact nature of the situation (e.g., compile-time and run-time polymorphism).

Difference between Method Overloading and Method Overriding:

                                                                                                                                                  
FeatureMethod OverloadingMethod Overriding
DefinitionDefining multiple methods in the same class with the same name but different parameter lists.Redefining a method in a child class that already exists in the parent class with the exact same signature.
Scope / LocationOccurs within the same class.Occurs between two classes that have an inheritance (parent-child) relationship.
ParametersMust be different (in number, order, or types of arguments).Must be exactly the same as the parent class method.
Type of PolymorphismCompile-time polymorphism (Static binding).Run-time polymorphism (Dynamic binding).
Return TypeCan be the same or different.Must be the same or covariant type.
Private/Static/Final MethodsPrivate, static, and final methods can be overloaded.Private, static, and final methods cannot be overridden.
Satt AI
Satt AI
2 weeks ago
31

Related Question

View All
উত্তরঃ

কম্পিউটারের মেমরি (Memory) ব্যবস্থায় RAM (Random Access Memory) এবং ROM (Read Only Memory) উভয়ই গুরুত্বপূর্ণ ভূমিকা পালন করে। এদের মৌলিক প্রকৃতি ও কার্যকারিতার মধ্যে বেশ কিছু সুস্পষ্ট পার্থক্য বিদ্যমান, যা নিচে একটি সারণীর মাধ্যমে ব্যাখ্যা করা হলো:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
বৈশিষ্ট্য (Feature)RAM (র‍্যাম)ROM (রম)
পুরো নাম (Full Name)Random Access MemoryRead Only Memory
প্রকৃতি (Nature)এটি একটি Volatile (উদ্বায়ী) মেমরি।এটি একটি Non-volatile (অনুদ্বায়ী) মেমরি।
ডেটা সংরক্ষণ (Data Storage)অস্থায়ীভাবে ডেটা সংরক্ষণ করে। কম্পিউটার চালু থাকাকালীন ডেটা ও প্রোগ্রাম লোড করে।স্থায়ীভাবে ডেটা সংরক্ষণ করে। গুরুত্বপূর্ণ সিস্টেম ফাইল ও ফার্মওয়্যার (Firmware) থাকে।
ডেটা পরিবর্তন (Data Modification)ডেটা পড়া (Read) এবং লেখা (Write) উভয়ই করা যায়, অর্থাৎ ডেটা পরিবর্তনযোগ্য।সাধারণত শুধু ডেটা পড়া যায়; ডেটা লেখা বা পরিবর্তন করা কঠিন বা বিশেষ পদ্ধতির প্রয়োজন।
গতি (Speed)ROM-এর চেয়ে অনেক দ্রুত কাজ করে।RAM-এর চেয়ে ধীর গতিসম্পন্ন।
বিদ্যুৎ চলে গেলে (Power Off)বিদ্যুৎ সরবরাহ বন্ধ হলে এতে সংরক্ষিত সমস্ত ডেটা হারিয়ে যায়।বিদ্যুৎ সরবরাহ বন্ধ হলেও এতে সংরক্ষিত ডেটা অক্ষত থাকে।
ব্যবহার (Usage)অপারেটিং সিস্টেম (Operating System), অ্যাপ্লিকেশন প্রোগ্রাম (Application Program) এবং বর্তমান কাজের ডেটা লোড করার জন্য ব্যবহৃত হয়।কম্পিউটার চালু করার জন্য প্রয়োজনীয় বুটস্ট্র্যাপ নির্দেশাবলী (Bootstrap Instructions) এবং বায়োস (BIOS) বা ইউইএফআই (UEFI) ফার্মওয়্যার সংরক্ষণ করে।
ক্ষমতা (Capacity)সাধারণত GB (গিগাবাইট)-এর এককে পরিমাপ করা হয় (যেমন: 4GB, 8GB, 16GB)।সাধারণত MB (মেগাবাইট)-এর এককে পরিমাপ করা হয় (যেমন: 4MB, 8MB, 16MB)।
উদাহরণ (Examples)DRAM (Dynamic RAM), SRAM (Static RAM)।PROM (Programmable ROM), EPROM (Erasable PROM), EEPROM (Electrically Erasable PROM)।

সংক্ষেপে, RAM একটি দ্রুত, অস্থায়ী কার্যকারী মেমরি যা কম্পিউটারকে বর্তমান কাজগুলো সম্পাদন করতে সাহায্য করে, অন্যদিকে ROM একটি ধীর, স্থায়ী মেমরি যা কম্পিউটার চালু করার জন্য অপরিহার্য মৌলিক নির্দেশাবলী সংরক্ষণ করে।

Satt AI
Satt AI
1 month ago
341
শিক্ষকদের জন্য বিশেষভাবে তৈরি

১ ক্লিকে প্রশ্ন, শীট, সাজেশন
অনলাইন পরীক্ষা তৈরির সফটওয়্যার!

শুধু প্রশ্ন সিলেক্ট করুন — প্রশ্নপত্র অটোমেটিক তৈরি!

প্রশ্ন এডিট করা যাবে
জলছাপ দেয়া যাবে
ঠিকানা যুক্ত করা যাবে
Logo, Motto যুক্ত হবে
অটো প্রতিষ্ঠানের নাম
অটো সময়, পূর্ণমান
প্রশ্ন এডিট করা যাবে
জলছাপ দেয়া যাবে
ঠিকানা যুক্ত করা যাবে
Logo, Motto যুক্ত হবে
অটো প্রতিষ্ঠানের নাম
অটো সময়, পূর্ণমান
অটো নির্দেশনা (এডিটযোগ্য)
অটো বিষয় ও অধ্যায়
OMR সংযুক্ত করা যাবে
ফন্ট, কলাম, ডিভাইডার
প্রশ্ন/অপশন স্টাইল পরিবর্তন
সেট কোড, বিষয় কোড
অটো নির্দেশনা (এডিটযোগ্য)
অটো বিষয় ও অধ্যায়
OMR সংযুক্ত করা যাবে
ফন্ট, কলাম, ডিভাইডার
প্রশ্ন/অপশন স্টাইল পরিবর্তন
সেট কোড, বিষয় কোড
এখনই শুরু করুন ডেমো দেখুন
৫০,০০০+
শিক্ষক
৩০ লক্ষ+
প্রশ্নপত্র
মাত্র ১৫ পয়সায় প্রশ্নপত্র
১ ক্লিকে প্রশ্ন, শীট, সাজেশন তৈরি করুন আজই

Complete Exam
Preparation

Learn, practice, analyse and improve

1M+ downloads
4.6 · 8k+ Reviews