0% found this document useful (0 votes)
21 views20 pages

1 Lesson

The document discusses the basics of object-oriented programming (OOP) including defining a class and creating objects, OOP languages like Java, and attributes and methods as properties of objects. It also covers core OOP principles such as inheritance, polymorphism, encapsulation, and abstraction. The presentation aims to explain fundamental OOP concepts through examples and analogies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views20 pages

1 Lesson

The document discusses the basics of object-oriented programming (OOP) including defining a class and creating objects, OOP languages like Java, and attributes and methods as properties of objects. It also covers core OOP principles such as inheritance, polymorphism, encapsulation, and abstraction. The presentation aims to explain fundamental OOP concepts through examples and analogies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

OOP basics

Speaker: Iskakov Y.K


01
In Today’s module
OOP basics

02 OOP Languages

03 Attributes and Methods


01
Part
What is OOP?

Analogy of the structure of the OOP:

«Programmer» - class
Daniyar – object
Classes and objects
02
Part
OOP languages
Java OOP syntax

To create a class To create an object


03
Part
Attributes and methods

An object is a collection of variables and


Class: functions, as in traditional functional
programmer
programming. Variables and functions are its
properties.
Object:
Daniyar Attributes are variables that are specific
characteristics of an object, such as the color
Attributes: of a field or a user's name.
programmer
Methods are functions that are defined within
an object or class. They refer to a specific
Methods:
writing code object and allow you to interact with them or
other parts of the code.
04
Part
Basic concepts of object-oriented programming
Inheritance
Inheritance allows you to implement
complex schemes with a clear hierarchy
“from general to specific.” This makes the
code easier to understand and scale.
There is no need to rewrite the same
properties many times in different objects.
It is enough to inherit these objects from
one “parent”, and the “parent” properties
will be applied automatically.

Single inheritance Multiple inheritance


Polymorphism

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 {

OOP uses the principle of private int year;


private String company;
encapsulation - another basic principle public SomePhone(int year, String company) {
of OOP, in which the attributes and this.year = year;
this.company = company;
behavior of an object are combined in }
private void openConnection(){
one class, the internal implementation //findComutator
//openNewConnection...
of the object is hidden from the user, }
public void call() {
and an open interface is provided for openConnection();
working with the object. }
System.out.println("Calling the number");

public void ring() {


System.out.println("Ting-ding");
}

}
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

Find more illustrations like these on Stories by Freepik


Our Consultants

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

You might also like