Ra2 Singca Dat2b
Ra2 Singca Dat2b
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
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
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.
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