SlideShare a Scribd company logo
Hello!
We are Team
Quadra
Our Group members are:
Nafiz Ar Rafi (ID: 17182103359)
Shohana Iasmin (ID: 17182103322)
MD. Maruf Hossain (ID:
Sinthia Sayeed (ID:
Rokonuzzaman Razu (ID: 17182103211)
1
Presentation On Object
Oriented programming
(OOP)
Java OOP basic feature
1
Features of OOP
Abstraction: In Java, abstraction means simple things
like objects, classes and variables represent more
complex underlying code and data. This is important
because it lets you avoid repeating the same work
multiple times.
Encapsulation: The practice of keeping fields within a
class private, then providing access to those fields via
public methods. Encapsulation is a protective barrier
that keeps the data and code safe within the class
itself.
Polymorphism: Allows programmers to use the same
word in Java to mean different things in different
contexts. One form of polymorphism is method
overloading. The other form is method overriding.
Inheritance: Inheritance is a special feature of Object-
Oriented Programming in Java that lets programmers
create new classes that share some of the attributes of
existing classes.
4
“
5
The simple abstraction example that is given above has a
class Car. In this class Car, we have an abstract method to
accelerate (). Then we inherit this class in the Suzuki class.
Inside the Suzuki class, we implement the accelerated
method.
Example of Abstraction
Example of Encapsulation
6
Encapsulation is demonstrated as an OOP concept in Java. Here, the
variable “name” is kept private or “encapsulated.”
7
Example of Polymorphism
In this example, we are creating two classes Bike and Splendor. Splendor class
extends Bike class and overrides its run() method. We are calling the run method by
the reference variable of Parent class. Since it refers to the subclass object and
subclass method overrides the Parent class method, the subclass method is invoked at
runtime
Example of Inheritance
8
In the above example, Programmer object can access the field of own class as
well as of Employee class.
Access Modifier
2
What are the Access
modifiers?
We can change the access level of fields,
constructors, methods, and classes in Java
programs by applying the access modifier to
them. The access level refers to the
accessibility or scope of a field, method,
constructor, or class.
10
Access
Modifi
er
There are four types of java access
modifiers
11
Private modifier: The access level of a private modifier is only within the class. It cannot be accessed from outside
the class.
Default modifier: The access level of a default modifier is only within the package. It cannot be accessed from
outside the package. If you do not specify any access level, it will be the default.
Protected modifier: The access level of a protected modifier is within the package and outside the package through
child class. If you do not make the child class, it cannot be accessed from outside the package.
Public modifier: The access level of a public modifier is everywhere. It can be accessed from within the class,
outside the class, within the package and outside the package.
Constructor And Destructor
3
What is Java
constructor and
destructor?
13
A constructor is used to initialize a variable that means it allocates memory for the same A
constructor is nothing but automatic initialization of the object. Whenever the program
creates an object at that time constructor, is gets called automatically. You don’t need to
call this method explicitly.
On the other hand, Destructor is used to free that memory allocated during initialization.
Generally, in java, we don’t need to call the destructor explicitly. Java has a feature of
automatic garbage collection.
Why Constructor and
destructor is needed?
14
Constructor and destructor are mostly used to
handle memory allocation and de-allocation
efficiently.
Constructor and destructor do a very important role
in any programming language of initializing and
destroying it after use to free up the memory space.
Interface in Java
4
What do Interface mean in
java programming?
16
An interface is a programming structure/syntax that allows the
computer to enforce certain properties on an object (class).
For example: say we have a car class and a scooter class and a truck class. Each of
these three classes should have a start_engine() action. How the "engine is started" for
each vehicle is left to each particular class, but the fact that they must have a
start_engine action is the domain of the interface.
Static Variable
5
What is Static Variable
if we declare any variable as static, it is known as a static variable.
18
The static variable can be used to refer to the common property of all
objects.
For example, the company name of employees, University name of
students, etc. It makes your program memory efficient
Let’s see how static
variable in java is created
19
6
Let's explain:
We created a class called Student with three variables –
studentName, course, and University.
The first instance – Student1 – which has access to the
variables created in its class had these values:
Student1.studentName = “AB";
Student1.course = "Data Visualization";
Student1.University = “BUBT";
Second instance –Student2 - had these values:
Student2.studentName = "CD";
Student2.course = "Data Analysis with Java";
As we declare University as a static variable that’s why we didn’t
have to create its object in the second instance.
Diagram
21
Student
-studentName: String
-course: String
-University: String
Student1
+studentName: String
+course: String
+University: String
Student2
+studentName: String
+course: String
Class: Student
First Instance Class: Student1 Second Instance Class: Student2
22
Explain:
Student Class has this types of values –
-studentName: String
-course: String
-University: String
The first instance – Student1 – has these values-
+studentName: String
+course: String
+University: String
Second instance – Student2- has these values-
+studentName: String
+course: String
Thanks!
That’s all from our
side
23

More Related Content

PPTX
chapter 5 concepts of object oriented programming
PPTX
Nitish Chaulagai Java1.pptx
PPT
Java_notes.ppt
PPT
oops with java modules i & ii.ppt
PPTX
Android Training (Java Review)
DOCX
Java Interview Questions For Freshers
PDF
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
PDF
Java Programming Paradigms Chapter 1
chapter 5 concepts of object oriented programming
Nitish Chaulagai Java1.pptx
Java_notes.ppt
oops with java modules i & ii.ppt
Android Training (Java Review)
Java Interview Questions For Freshers
Java Progamming Paradigms, OOPS Concept, Introduction to Java, Structure of J...
Java Programming Paradigms Chapter 1

Similar to OOP in Java Presentation.pptx (20)

PPTX
Object Oriented Programming Tutorial.pptx
PDF
Classes and Object Concept Object Oriented Programming in Java
PPT
java
PPT
Java is an Object-Oriented Language
PDF
Programming Laboratory Unit 1.pdf
PPTX
Java 102 intro to object-oriented programming in java
PPT
Md02 - Getting Started part-2
DOCX
Computer Programming 2
PPT
Unidad o informatica en ingles
PPTX
Presentation2.ppt java basic core ppt .
PDF
Core Java Introduction | Basics
PDF
Introduction to Java Object Oiented Concepts and Basic terminologies
PPT
Md03 - part3
PDF
CS8392-OOPS-Printed-Notes-All-Units.pdf for students
PPTX
PPT Lecture-1.4.pptx
PPTX
Java OOPS Concept
PDF
Oops concepts
ODP
Synapseindia reviews.odp.
PDF
Java introduction
DOCX
java tr.docx
Object Oriented Programming Tutorial.pptx
Classes and Object Concept Object Oriented Programming in Java
java
Java is an Object-Oriented Language
Programming Laboratory Unit 1.pdf
Java 102 intro to object-oriented programming in java
Md02 - Getting Started part-2
Computer Programming 2
Unidad o informatica en ingles
Presentation2.ppt java basic core ppt .
Core Java Introduction | Basics
Introduction to Java Object Oiented Concepts and Basic terminologies
Md03 - part3
CS8392-OOPS-Printed-Notes-All-Units.pdf for students
PPT Lecture-1.4.pptx
Java OOPS Concept
Oops concepts
Synapseindia reviews.odp.
Java introduction
java tr.docx

Recently uploaded (20)

PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Lesson notes of climatology university.
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
IGGE1 Understanding the Self1234567891011
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PDF
advance database management system book.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Indian roads congress 037 - 2012 Flexible pavement
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
RMMM.pdf make it easy to upload and study
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Lesson notes of climatology university.
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
IGGE1 Understanding the Self1234567891011
History, Philosophy and sociology of education (1).pptx
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Weekly quiz Compilation Jan -July 25.pdf
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Computing-Curriculum for Schools in Ghana
Digestion and Absorption of Carbohydrates, Proteina and Fats
advance database management system book.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Final Presentation General Medicine 03-08-2024.pptx
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
A powerpoint presentation on the Revised K-10 Science Shaping Paper

OOP in Java Presentation.pptx

  • 1. Hello! We are Team Quadra Our Group members are: Nafiz Ar Rafi (ID: 17182103359) Shohana Iasmin (ID: 17182103322) MD. Maruf Hossain (ID: Sinthia Sayeed (ID: Rokonuzzaman Razu (ID: 17182103211) 1
  • 3. Java OOP basic feature 1
  • 4. Features of OOP Abstraction: In Java, abstraction means simple things like objects, classes and variables represent more complex underlying code and data. This is important because it lets you avoid repeating the same work multiple times. Encapsulation: The practice of keeping fields within a class private, then providing access to those fields via public methods. Encapsulation is a protective barrier that keeps the data and code safe within the class itself. Polymorphism: Allows programmers to use the same word in Java to mean different things in different contexts. One form of polymorphism is method overloading. The other form is method overriding. Inheritance: Inheritance is a special feature of Object- Oriented Programming in Java that lets programmers create new classes that share some of the attributes of existing classes. 4
  • 5. “ 5 The simple abstraction example that is given above has a class Car. In this class Car, we have an abstract method to accelerate (). Then we inherit this class in the Suzuki class. Inside the Suzuki class, we implement the accelerated method. Example of Abstraction
  • 6. Example of Encapsulation 6 Encapsulation is demonstrated as an OOP concept in Java. Here, the variable “name” is kept private or “encapsulated.”
  • 7. 7 Example of Polymorphism In this example, we are creating two classes Bike and Splendor. Splendor class extends Bike class and overrides its run() method. We are calling the run method by the reference variable of Parent class. Since it refers to the subclass object and subclass method overrides the Parent class method, the subclass method is invoked at runtime
  • 8. Example of Inheritance 8 In the above example, Programmer object can access the field of own class as well as of Employee class.
  • 10. What are the Access modifiers? We can change the access level of fields, constructors, methods, and classes in Java programs by applying the access modifier to them. The access level refers to the accessibility or scope of a field, method, constructor, or class. 10 Access Modifi er
  • 11. There are four types of java access modifiers 11 Private modifier: The access level of a private modifier is only within the class. It cannot be accessed from outside the class. Default modifier: The access level of a default modifier is only within the package. It cannot be accessed from outside the package. If you do not specify any access level, it will be the default. Protected modifier: The access level of a protected modifier is within the package and outside the package through child class. If you do not make the child class, it cannot be accessed from outside the package. Public modifier: The access level of a public modifier is everywhere. It can be accessed from within the class, outside the class, within the package and outside the package.
  • 13. What is Java constructor and destructor? 13 A constructor is used to initialize a variable that means it allocates memory for the same A constructor is nothing but automatic initialization of the object. Whenever the program creates an object at that time constructor, is gets called automatically. You don’t need to call this method explicitly. On the other hand, Destructor is used to free that memory allocated during initialization. Generally, in java, we don’t need to call the destructor explicitly. Java has a feature of automatic garbage collection.
  • 14. Why Constructor and destructor is needed? 14 Constructor and destructor are mostly used to handle memory allocation and de-allocation efficiently. Constructor and destructor do a very important role in any programming language of initializing and destroying it after use to free up the memory space.
  • 16. What do Interface mean in java programming? 16 An interface is a programming structure/syntax that allows the computer to enforce certain properties on an object (class). For example: say we have a car class and a scooter class and a truck class. Each of these three classes should have a start_engine() action. How the "engine is started" for each vehicle is left to each particular class, but the fact that they must have a start_engine action is the domain of the interface.
  • 18. What is Static Variable if we declare any variable as static, it is known as a static variable. 18 The static variable can be used to refer to the common property of all objects. For example, the company name of employees, University name of students, etc. It makes your program memory efficient
  • 19. Let’s see how static variable in java is created 19
  • 20. 6 Let's explain: We created a class called Student with three variables – studentName, course, and University. The first instance – Student1 – which has access to the variables created in its class had these values: Student1.studentName = “AB"; Student1.course = "Data Visualization"; Student1.University = “BUBT"; Second instance –Student2 - had these values: Student2.studentName = "CD"; Student2.course = "Data Analysis with Java"; As we declare University as a static variable that’s why we didn’t have to create its object in the second instance.
  • 21. Diagram 21 Student -studentName: String -course: String -University: String Student1 +studentName: String +course: String +University: String Student2 +studentName: String +course: String Class: Student First Instance Class: Student1 Second Instance Class: Student2
  • 22. 22 Explain: Student Class has this types of values – -studentName: String -course: String -University: String The first instance – Student1 – has these values- +studentName: String +course: String +University: String Second instance – Student2- has these values- +studentName: String +course: String