Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
6.Materi Java Eclipse 6
1. FIRMAN NURDIYANSYAH – TEKNIK INFORMATIKA 1
UNIVERSITAS WIDYAGAMA MALANG
JAVA 6
CONCEPT OF OBJECT ORIENTED PROGRAMMING
(OOP)
ABSTRACT
encapsulation
INHERITANCE
polymorphisms
Definition
Object-oriented programming, or more commonly known as foreign - Object Oriented
Programming (OOP) is the core of the Java programming. All the Java program object.
Therefore, before you start writing a Java program code contained in the chapters that follow,
you should first know the basics of the concepts contained in the object-oriented programming.
Some characteristics of object-oriented programming is Abstraction, Encapsulation, Inheritance
, and polymorphisms. Discussion detail about each feature of OOP above will be studied further
in other chapters in this book, which is when we talk about class.
1. Abstract
Abstraction is the ability of a program to bypass aspects of information processed by it,
that the ability to focus on the core. Every object in the system serves as a model of the
"perpetrators" abstract that can do the work, reports and changes in circumstances, and
communicate with other objects in the system, without revealing how this excess is
applied. Processes, functions or methods can also be made abstract, and some of the
techniques used to develop an abstraction.
2. FIRMAN NURDIYANSYAH – TEKNIK INFORMATIKA 2
UNIVERSITAS WIDYAGAMA MALANG
Example :
2. Enkapsulation
Encapsulation is an object Ensuring users can not change the state of an object in a way
that is not feasible; The only method in the object that is given permission to access the
situation. Each object access interface that specifies how other objects can interact with
it. Other objects will not know and rely on the representation of the object.
3. FIRMAN NURDIYANSYAH – TEKNIK INFORMATIKA 3
UNIVERSITAS WIDYAGAMA MALANG
Example :
1. Create a Class encapsulation
2. Create a Class encapsulation1
3. Inheritance
Inheritance is a major advantage in object-oriented programming as a property or
method defined in a superclass, that behavior is automatically inherited by all
subclasses. So, you can write code only once and their method could be used by all
subclasses. Subclass only need to implement the differences between itself and its
parent.
4. FIRMAN NURDIYANSYAH – TEKNIK INFORMATIKA 4
UNIVERSITAS WIDYAGAMA MALANG
Example :
1. Create a Class Person
5. FIRMAN NURDIYANSYAH – TEKNIK INFORMATIKA 5
UNIVERSITAS WIDYAGAMA MALANG
2. Create a Class Mahasiswa
3. Polymorphism
Polymorphism is the disguise in which a shape can have more than one form. an action
that allows programmers to convey a specific message out of the object hierarchy, in
which different objects give feedback / response to the same message in accordance
with the nature of each object. Polymorphism can mean many forms, meaning that we
can override (override), a method, derived from the parent class (super class) where the
object is lowered, so it has a different behavior.
6. FIRMAN NURDIYANSYAH – TEKNIK INFORMATIKA 6
UNIVERSITAS WIDYAGAMA MALANG
Example
Make three Class with the name of the animal, equine, animal sound