1 Lesson
1 Lesson
02 OOP Languages
«Programmer» - class
Daniyar – object
Classes and objects
02
Part
OOP languages
Java OOP syntax
Polymorphism in object-oriented
programming is the ability to process
different types of data, that is, belonging to
different classes, using the “same”
function, or method. In fact, only the
method name is the same; its source code
depends on the class. In addition, the
results of the same methods can differ
significantly. Therefore, in this context,
polymorphism refers to many forms of the
same word - the name of a method.
Encapsulation
public class SomePhone {
}
Abstraction
If you look at the most modern and the very
first telephone, you can immediately
identify the most important details that are
important both for a device from the late public abstract class AbstractPhone {
private int year;
19th century and for an ultra-modern
smartphone. This is making a call (dialing a public AbstractPhone(int year) {
number) and receiving a call. Essentially, this.year = year;
this is what makes a phone a phone and }
public abstract void call(int outputNumber);
not something else. Now we have applied public abstract void ring (int inputNumber);
the principle in OOP - highlighting the most }
important characteristics and information
about an object. This principle of OOP is
called abstraction.
Review your
knowledge with
tasks!
See you in the next
module
Alternative Resources
John James
Venus is the
Jane Patterson second planet Joe Doe
Mercury is the from the Sun Neptune is the
closest planet to farthest planet
the Sun from the Sun