100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Object Oriented Programming $10.49
Add to cart

Class notes

Object Oriented Programming

 4 views  0 purchase
  • Course
  • Institution

This document in depth concept of Object Oriented Programming, including object, class, constructor, encapsulation, interface etc

Preview 2 out of 9  pages

  • May 2, 2024
  • 9
  • 2023/2024
  • Class notes
  • Andrew rudder
  • All classes
avatar-seller
Object Oriented Programming

Step 1: Understanding the Basics
Very first question arises: Why do we need Object Oriented Programming and where do we
use it?

INTRODUCTION TO PROGRAMMING

Q. What is the Programming Paradigm?
The programming paradigm is like a recipe for cooking— it's a way of organising ingredients
(code) and steps (logic) to create a dish (software).

Q. What is Object Oriented Programming(OOPs)?
So, it is a programming paradigm which is used in software development. Here, Objects

methods.

● Advantages of OOPs:
P
contain data, in the form of fields(known as attributes or properties ), and code, in the form of




OOP includes modularity, reusability, flexibility, and easier maintenance of code.
O
1) Modularity: OOP allows for breaking down complex systems into smaller,
manageable modules (classes), improving code organisation and readability.

2) Reusability: Objects and classes can be reused in different parts of a program
or in different programs altogether, reducing development time and
redundancy(unnecessary).
O
3) Flexibility: OOP supports polymorphism and inheritance, enabling code to
adapt to changing requirements and facilitating easier extension and
modification.

4) Easier Maintenance: The encapsulation of data and behaviour within objects
promotes better code maintenance. By doing this, changes to one part of the
code don't mess up other parts, making it easier to fix and update code without
causing problems elsewhere.



Q. What if you do not use Object Oriented Programming?

1. Procedural Complexity: Without OOP, code tends to become more procedural,
leading to a lack of modularity and increased complexity.
2. Limited Reusability: Procedural programming may lack the built-in mechanisms for
code reuse provided by OOP. Without classes and objects, developers may need to

, duplicate code or rely on external libraries to achieve similar levels of reuse, leading
to bloated codebases and potential inconsistencies.
3. Difficulty in Scaling and Maintenance: As the size and complexity of a project
increase, procedural code may become unwieldy and difficult to manage.




BASIC CONCEPTS OF OOP



Q. What is Class?
Class is a template to create objects. A class contains the fields like variables, methods,
properties, constructors, etc. In simple terms, think of objects as things you can see and touch
in the real world, like a car or a dog. Classes are like blueprints that describe what these
objects can do and what they are made of.




Q. What are Objects?

P
● For example: So, if "car" is a class, then your own car (Mustang) would be an Object
created from that class.



Objects is an instance of a class. You will instantiate a new object by allocating some
space in the memory using the ‘new’ keyword.
O
● It represents a specific entity or thing in your program, such as a car, a person, or a
bank account.
● Objects have attributes (also called properties or fields) that describe their
characteristics and behaviours (also called methods or functions) that define their
actions.
● Objects perform the actions defined by the methods in a class. Something only
O
becomes an object when it actually takes up space in your RAM.

Q. What are Constructors?
Constructor are called when an instance of an class is created , typically using ‘new’
keyword. Constructor have the same name and does not have any return type not even void.
Purpose of Constructors:
● Initialization: Constructor is initialize the value when the object is created. It is a part
of an object.
● Memory Allocation: Constructors allocate memory for the object and set up the
initial state of the object.

There are three types of constructors:

1) Non-Parameterized constructor: A constructor which has no argument
2) Parameterized constructor: Constructor which has parameter
3) Copy constructor: an overloaded constructor used to declare and initialise an object
from another object.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller patelmack0702. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

56326 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.49
  • (0)
Add to cart
Added