0% found this document useful (0 votes)
3 views14 pages

Module 1 - Basic Java OOP Concepts

Object-Oriented Programming (OOP) is a programming model that organizes software design around data, or objects, which have unique attributes and behaviors. Key concepts include classes, objects, methods, and the four pillars of OOP: encapsulation, abstraction, inheritance, and polymorphism. OOP offers advantages over procedural programming, such as easier implementation, faster execution, and improved code reusability.
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)
3 views14 pages

Module 1 - Basic Java OOP Concepts

Object-Oriented Programming (OOP) is a programming model that organizes software design around data, or objects, which have unique attributes and behaviors. Key concepts include classes, objects, methods, and the four pillars of OOP: encapsulation, abstraction, inheritance, and polymorphism. OOP offers advantages over procedural programming, such as easier implementation, faster execution, and improved code reusability.
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

BASIC JAVA OOP

CONCEPTS
DCIT50
Object Oriented Programming(OOP)
Object-Oriented Programming is a computer programming
model that organizes software design around data, or objects,
rather than functions and logic. An object can be defined as a data
field that has unique attributes and behavior. OOP models real-
world entities and relationships through objects, which represent
things with attributes (properties) and behaviors (methods).
The first step in OOP is to collect all of the objects a
programmer wants to manipulate and identify how they relate to
each other -- an exercise known as data modeling.
LET’S BREAKDOWN THE
PHRASE OBJECT
ORIENTED
PROGRAMMING
Object is a self-
contained entity that
contains Attributes
(data) and Methods
(functions). It is also
an instance of a
class which is a
blueprint that
defines what
attributes and
behaviors the
objects of that type
will have.
Oriented – means
the programming is
focused or organized
around objects.
Instead of structuring
a program around
procedures or
functions, as in
procedural
programming, OOP
organizes software
development around
objects and the
relationships
between them.
Programming –
refers to the actual
process of writing
code. In Object-
Oriented
Programming, you
write code that
defines objects and
how they interact. It
uses OOP principles
(encapsulation,
inheritance,
polymorphism, and
abstraction) to solve
problems.
To make it simplified;
◦ Object: Represents a real-world entity or concept in the system,
with data (attributes) and behaviors (methods).
◦ Oriented: The program is organized around objects and their
interactions, rather than procedures or functions.
◦ Programming: The process of creating and manipulating
objects through code, applying the principles of OOP
(encapsulation, inheritance, polymorphism, and abstraction).
Object Oriented Programming Structure
◦ Classes - are user-defined data types that act as the blueprint for
individual objects, attributes and methods.
◦ Objects - are instances of a class created with specifically defined data.
Objects can correspond to real-world objects or an abstract entity. When
class is defined initially, the description is the only object that is defined.
◦ Methods - are functions that objects can perform. They are defined
inside a class that describe the behaviors of an object. Each method
contained in class definitions starts with a reference to an instance object.
Additionally, the subroutines contained in an object are called instance
methods. Programmers use methods for reusability or keeping
functionality encapsulated inside one object at a time.
Object Oriented Programming Structure
◦ Attributes - represents the state of an object. In other words, they are the
characteristics that distinguish classes. Objects have data stored in the
attributes field. Class attributes belong to the class itself and are defined
in the class template.
◦ Four Pillars of OOP (Encapsulation, Abstraction, Inheritance,
Polymorphism)
Four Pillars of OOP
◦ Encapsulation – is a process of binding data members (attributes) and
methods together. The encapsulation restricts direct access to important
data.
◦ Abstraction – is a technique of hiding internal details and showing
functionalities. The abstract classes and interfaces are used to achieve
abstraction in Java.
◦ Inheritance - is a process by which we can reuse the functionalities of
existing classes to new classes. In the concept of inheritance, there are
two terms base (parent) class and derived (child) class. When a class is
inherited from another class (base class), it (derived class) obtains all the
properties and behaviors of the base class.
Four Pillars of OOP
◦ Polymorphism - The term "polymorphism" means "many forms". In
object-oriented programming, polymorphism is useful when you want to
create multiple forms with the same name of a single entity. To
implement polymorphism in Java, we use two concepts method
overloading and method overriding.
◦ The method overloading is performed in the same class where we have multiple
methods with the same name but different parameters, whereas, the method
overriding is performed by using the inheritance where we can have multiple
methods with the same name in parent and child classes.
Advantages of OOP over Procedure-
Oriented Programming language:
◦ The implementations of OOPs concepts are easier.
◦ The execution of the OOPs is faster than procedural-oriented
programming.
◦ OOPs provide code reusability so that a programmer can reuse
an existing code.
◦ OOPs help us to keep the important data hidden.
Java Naming Conventions
Naming conventions are a set of guidelines that
developers follow to write clear and readable code. While they
are not enforced by the compiler, following these conventions
improves code readability and maintainability.
Advantages of Naming Conventions in Java
◦ Readability: Consistent naming makes it easier for developers to read
and understand code.
◦ Maintainability: Teams can work more effectively together when they
follow common conventions.
◦ Avoiding Ambiguity: Clear, descriptive names reduce confusion
about what a class, method, or variable does.
◦ Industry Standards: Following widely accepted conventions ensures
that your code can be easily understood by other developers familiar
with Java.

You might also like