0% found this document useful (0 votes)
32 views3 pages

Ra2 Singca Dat2b

The document is a research assignment that discusses object-oriented programming (OOP). It begins by defining OOP and explaining that it revolves around structuring software design around objects rather than functions. It then explains key features of OOP including abstraction, encapsulation, inheritance, and polymorphism. It differentiates between classes and objects, describing classes as templates for objects. Finally, it discusses the concept of methods, explaining that methods define an object's behaviors and can be called on objects to perform operations.

Uploaded by

John Singca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

Ra2 Singca Dat2b

The document is a research assignment that discusses object-oriented programming (OOP). It begins by defining OOP and explaining that it revolves around structuring software design around objects rather than functions. It then explains key features of OOP including abstraction, encapsulation, inheritance, and polymorphism. It differentiates between classes and objects, describing classes as templates for objects. Finally, it discusses the concept of methods, explaining that methods define an object's behaviors and can be called on objects to perform operations.

Uploaded by

John Singca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

BATAAN PENINSULA STATE UNIVERSITY – MAIN CAMPUS

COLLEGE OF INFORMATION AND COMMUNICATIONS TECHNOLOGY


1ST SEMESTER, A.Y. 2023-2024

CTCC0513 – DATA STRUCTURES AND ALGORITHMS

JOHN CARL S. SINGCA


BS ENTERTAINMENT & MULTIMEDIA COMPT – DAT2B
Research Assignment 02

1. What is object-oriented programming (OOP)?

Object-oriented programming (OOP) represents a programming approach characterized


by the classification of objects into classes, closely intertwined with the associated
methods (functions). This methodology also incorporates the concept of inheriting
attributes and methods. OOP is grounded in a mathematical field known as 'abstract
data types,' which facilitates the storage of data alongside the necessary procedures for
its manipulation. OOP introduces the potential to elevate programming to a more
abstract and advanced level.

In essence, object-oriented programming serves as a design philosophy or methodology


for computer programming. It revolves around structuring software design based on data
or objects rather than focusing primarily on functions and logical operations.

2. Explain the following features of OOP:

Abstraction

Abstraction is a concept that enables us to conceal the inner workings of a system from
users, revealing only the essential information they need. By employing this concept,
developers can easily introduce changes and enhancements over time. In addition,
Abstraction involves the act of concealing the intricate implementation details of an
object, granting users the ability to interact with it without needing to understand its
internal workings.

Encapsulation

Encapsulation serves as a mechanism that consolidates data and functions within a


class into a unified entity. This consolidation not only shields the data and functions from
external interference and misuse but also enhances security. A class represents a prime
example of encapsulation.

Inheritance

Inheritance entails the procedure of creating fresh objects based on existing ones. This
approach empowers developers to recycle code and fabricate more intricate objects
without commencing from scratch.

Polymorphism

Polymorphism embodies the capacity of an object to assume multiple forms. It enables


the creation of methods bearing the same name but distinct method signatures.
Consequently, it empowers developers to craft code that is clean, comprehensible,
readable, and robust.

3. Differentiate classes from objects.

A class is a template or blueprint for creating objects. It defines the properties and
behaviors that all objects of that class will have. An object is an instance of a class. It is
a concrete entity that has the properties and behaviors defined by its class.

Another way to think about it is that a class is a type, and an object is a variable of that
type. For example, the “Car” class is a type, and a Honda Civic car is a variable of that
type.
4. Discuss the concept of method in OOP and explain how a method works.

A method in object-oriented programming (OOP) is a function that is associated with a


class. It defines the behavior of objects of that class. Methods can be used to perform
actions on an object, such as setting or getting its properties, or to perform more
complex operations.

Methods are defined in the class definition, and they can be called on any object of that
class. To call a method on an object, you use the dot notation. For example, to call the
drive() method on a Car object, you would write car.drive().

Methods can also take parameters, which are values that are passed to the method
when it is called. For example, the drive() method on a Car object might take a
parameter that specifies the speed to drive.

When a method is called on an object, the code in the method is executed within the
context of that object. This means that the method has access to the object's properties
and methods.

Methods are a powerful feature of OOP that allows you to encapsulate code and reuse it
in different objects. They also make your code more modular and easier to maintain.

Reference
Definition of Object-oriented Programming - Gartner Information Technology Glossary. (n.d.).
Gartner. https://www.gartner.com/en/information-technology/glossary/oop-object-oriented-
programming#:~:text=Object%2Doriented%20programming%20(OOP)
What is Object-Oriented Programming - Javatpoint. (n.d.). Www.javatpoint.com. Retrieved
October 1, 2023, from https://www.javatpoint.com/what-is-object-oriented-
programming#:~:text=The%20object%2Doriented%20programming%20is
Doherty, E. (2020, April 15). What is Object Oriented Programming? OOP Explained in Depth.
Educative: Interactive Courses for Software Developers. https://www.educative.io/blog/object-
oriented-programming

You might also like