0% found this document useful (0 votes)
13 views4 pages

Assignment 1 - Understanding The OOP in Java - Richard C. Cayabyab

The document outlines an assignment on Object-Oriented Programming (OOP) in Java, detailing the core principles such as encapsulation, inheritance, polymorphism, and abstraction. It emphasizes the advantages of OOP, including modularity, reusability, flexibility, security, and scalability, while providing examples of how OOP is applied in Java. The assignment requires research and a summary in the student's own words, with references to be included.

Uploaded by

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

Assignment 1 - Understanding The OOP in Java - Richard C. Cayabyab

The document outlines an assignment on Object-Oriented Programming (OOP) in Java, detailing the core principles such as encapsulation, inheritance, polymorphism, and abstraction. It emphasizes the advantages of OOP, including modularity, reusability, flexibility, security, and scalability, while providing examples of how OOP is applied in Java. The assignment requires research and a summary in the student's own words, with references to be included.

Uploaded by

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

St.

Nicolas College of Business and Technology


2ndFlr. Mel-Vi Bldg., JASA Road
City of San Fernando, Pampanga

DEPARTMENT OF INFORMATION TECHNOLOGY

Assignment 1 - Understanding the OOP in Java

Instructions below read carefully:

1. Research:
● Conduct research on Object-Oriented Programming (OOP) concepts as
they apply to Java.
● Suggested areas to focus on:
○ What is OOP?
○ Core principles of OOP (Classes, Objects, Inheritance,
Encapsulation, Polymorphism).
○ Advantages of using OOP in Java.
○ Examples of how OOP is applied in Java.
● Use at least 2 or more valid resources for your research (e.g., online
articles, tutorials, videos, or textbooks). Then Include all the reference
links after your answer.
2. Explain:
● Write a summary of OOP in Java based on your research.
● The explanation should be in your own words and demonstrate your
understanding.

Note: Write your answer below or on the next page of this assignment also don’t
forget to include the reference basis on your research no reference no grade,
accomplishing this assignment is worth 30 points Good luck!
St. Nicolas College of Business and Technology
2ndFlr. Mel-Vi Bldg., JASA Road
City of San Fernando, Pampanga

DEPARTMENT OF INFORMATION TECHNOLOGY

Assignment 1 - Understanding the OOP in Java


Answers:
1. Research:
OOP means Object Oriented Programming, it’s a programming model that organizes
software around objects instead of logic, a popular programming approach that's
well suited for complex, large, and frequently updated software, and also a
technique that uses abstract data types to store data and the procedures needed to
process it. -Google
The core principles of object-oriented programming (OOP) are encapsulation,
inheritance, polymorphism, and abstraction. These principles are the foundation for
creating efficient, reusable, and modular code.
OBJECTS - are the basic units of OOP.
They are data fields with unique attributes and behaviors.
Objects know how to perform actions and interact with other program elements.
INHERITANCE - A new class, called a subclass, inherits properties and behaviors from
an existing class, called a superclass.
Inheritance also promotes code reuse and establishes relationships between classes.
ENCAPSULATION - Encapsulation is the process of bundling data with the methods
that operate on it.
Access modifiers like private, protected, and public control the visibility of an object's
properties and methods.
POLYMORPHISM - Polymorphism is the ability to access objects of different types
through the same interface.
It allows a program to redefine methods for derived classes.
ABSTRACTION - Abstraction is one of the core principles of OOP. -Google
Modularity. Encapsulation enables objects to be self-contained, making
troubleshooting and collaborative development easier.
Reusability. Code can be reused through inheritance, meaning a team does not have
to write the same code multiple times.
Productivity. Programmers can construct new programs quickly through the use of
multiple libraries and reusable code.
Easily upgradable and scalable. Programmers can implement system functionalities
independently.
Interface descriptions. Descriptions of external systems are simple, due to message-
passing techniques that are used for object communication.
Security. Using encapsulation and abstraction, complex code is hidden, software
St. Nicolas College of Business and Technology
2ndFlr. Mel-Vi Bldg., JASA Road
City of San Fernando, Pampanga

DEPARTMENT OF INFORMATION TECHNOLOGY

Assignment 1 - Understanding the OOP in Java


maintenance is easier and internet protocols are protected.
Flexibility. Polymorphism enables a single function to adapt to the class it is placed
in. Different objects can also pass through the same interface.
Code maintenance. Parts of a system can be updated and maintained without
needing to make significant adjustments.
Lower cost. Other benefits, such as its maintenance and reusability, reduce
development costs. -Google
OOP stands for Object-Oriented Programming. Procedural programming is about
writing procedures or methods that perform operations on the data, while object-
oriented programming is about creating objects that contain both data and methods.
Example: Class = Fruit / Objects = Apple, Banana, Mango
Example 2: Class = Car / Objects = Volvo, Audi, Toyota -w3schools.com
2. Explain:
Object-Oriented Programming (OOP) is a programming paradigm that revolves
around the concept of "objects," which are instances of classes. In Java, OOP is a core
approach used to design and build robust, modular, and reusable software. It
emphasizes organizing code into structures that mirror real-world entities, making it
intuitive and efficient for developers.
Core Principles of OOP in Java
Classes and Objects: A class acts as a blueprint that defines the properties
(attributes) and behaviors (methods) of objects. For instance, a Car class might define
attributes like color and model and behaviors like drive() and stop(). Objects are
specific instances of classes, such as a Toyota or a Honda, each having unique values
for their attributes.
Encapsulation: Encapsulation ensures that the internal state of an object is hidden
from the outside world. By using access modifiers like private, protected, and public,
developers can control how the data and methods are accessed or modified. For
example, sensitive data can be protected using private attributes and accessed via
public getter and setter methods, enhancing security and modularity.
Inheritance: Inheritance allows a new class (subclass) to inherit properties and
methods from an existing class (superclass). This promotes code reusability and
hierarchical relationships. For example, a Vehicle class can have a subclass Car that
inherits common properties like speed and capacity but can also add specific features
like airConditioning.
Polymorphism: Polymorphism enables objects to take on multiple forms. It allows
methods to be overridden in subclasses or shared through interfaces. For example, a
St. Nicolas College of Business and Technology
2ndFlr. Mel-Vi Bldg., JASA Road
City of San Fernando, Pampanga

DEPARTMENT OF INFORMATION TECHNOLOGY

Assignment 1 - Understanding the OOP in Java


Shape class might have a method draw(), and different subclasses like Circle and
Rectangle can implement draw() in their unique ways. This makes code more flexible
and adaptable.
Abstraction: Abstraction focuses on showing only the essential details while hiding
the complexity. Developers use abstract classes and interfaces to define generalized
behaviors. For instance, an interface Animal might define a method makeSound(),
while specific classes like Dog and Cat implement the method differently.
Advantages of OOP in Java
 Modularity: Encapsulation ensures that objects are self-contained, making
code easier to debug and maintain.
 Reusability: Inheritance allows developers to reuse existing code instead of
rewriting it.
 Flexibility: Polymorphism allows the same code to work with different data
types and classes.
 Security: Encapsulation and abstraction help safeguard sensitive data and
reduce complexity.
 Scalability: OOP makes it easier to add new features or scale the application
without disrupting existing functionality.
OOP in Action: Examples in Java
1. A Fruit class with objects like Apple, Banana, and Mango. Each fruit object can
have unique properties like color and taste while sharing common behaviors
like grow() or ripen().
2. A Car class with objects like Volvo, Audi, and Toyota. These objects inherit
shared properties like wheels and methods like startEngine() while also having
brand-specific features.
In conclusion, OOP in Java provides a powerful framework for designing software
that is intuitive, maintainable, and adaptable. Its principles of encapsulation,
inheritance, polymorphism, and abstraction enable developers to write clean and
efficient code, making Java a popular choice for object-oriented programming.
-Google, w3schools.com, Wikipedia

Submitted by: Richard C. Cayabyab

You might also like