SlideShare a Scribd company logo
2
Most read
3
Most read
10
Most read
https://www.besanttechnologies.com/trainin
g-courses/java-training
 Java abstraction or object-oriented
programming is a way of separating the
implementation of an interface and one of the
five motifs,
 along with encapsulation, inheritance,
polymorphism, class, and object abstraction.
 it is achieved using Java the interface and the
abstract class in Java. An interface or abstract
class is something that is not concrete,
 something that is incomplete.
 To use the interface or the abstract class, we
need to extend and implement an abstract
method with concrete behavior.
 An example of abstraction is to create an
interface to denote common behavior without
specifying Details on how this example
behavior works.
 An interface called Server is created that has
the start () and stop () method.
 This is called the server abstraction because
each server must have a way to start and stop
and the details may be different.
 As I said earlier, the Abstraction in Java is
implemented using abstract classes and
interfaces, as discussed in the next section.
 In truth, which is an abstraction in Java, the
difference between abstraction and
encapsulation is also a very popular Java
interview because the strong capacity of
OOPS is one of the main requirements for
Java developers.
 Abstraction is also one of the concepts
difficult to master. The programmer usually
mixes different levels of abstraction that
result in flexible code,
If you want to use it, you need to make it
complete or concrete, extending it. A class is
called concrete if it does not contain any
abstract method and implements the entire
abstract method inherited from the abstract
class or interface implemented.
By the way, Java has a concept of abstract
classes, abstract method, but a variable can not
be abstract in Java.
 A popular example of an abstract class in Java
is the ActionListener, which has an abstract
method called actionPerformed (ActionEvent
ae).
 This method is called when an ActionEvent is
activated as when the JButton is clicked.
 It is common in java to attach ActionListener
with JButton by implementing the
actionPerformed abstract method
(ActionEvent a) using the anonymous class.
 An abstract method in Java does not have the
body, it is just a statement. To use an
abstract method, it is necessary to replace
this method in the subclass.
 When you know that something needs to be
there, you do not know exactly how it should
be. For example.
When I'm creating a class called Vehicle, I know
there must be methods like start () and stop (),
but I do not know how this start and stop
method should work,
since each vehicle can have different start and
stop mechanism and .. g some they can be
initiated by kicking or some can be by pressing
buttons.
 If you know some behavior during the
creation of a class and this would remain
common to all subclasses, add it to an
abstract class.
 An interface like the Runnable interface is a
good example of Java abstraction that is used
to abstract the tasks performed by multiple
threads.
 Callable is another good summary of a task
that can return value.

More Related Content

PPTX
Abstraction java
PPTX
ppt Artificial intelligence .pptx
PPTX
Interface in java
PPTX
Women rights in islam
PPTX
Breadth First Search & Depth First Search
PPTX
oops concept in java | object oriented programming in java
PPTX
Type casting in java
PPT
Java interfaces
Abstraction java
ppt Artificial intelligence .pptx
Interface in java
Women rights in islam
Breadth First Search & Depth First Search
oops concept in java | object oriented programming in java
Type casting in java
Java interfaces

What's hot (20)

PPTX
Classes objects in java
PPTX
Abstraction in java
PPTX
Arrays in Java
PDF
Method Overloading In Java
PDF
Java threads
PPT
Inheritance in java
PPTX
Java abstract class & abstract methods
PPT
Abstract class
PPTX
Classes, objects in JAVA
ODP
OOP java
PPSX
Data Types & Variables in JAVA
PPTX
Abstract Class Presentation
PPTX
Inheritance in java
PPTX
Basic Concepts of OOPs (Object Oriented Programming in Java)
PPTX
Inheritance ppt
PPTX
Strings in Java
PPTX
Inner classes in java
PPTX
Abstract Class & Abstract Method in Core Java
PPTX
Access specifiers(modifiers) in java
PPTX
Inheritance in Java
Classes objects in java
Abstraction in java
Arrays in Java
Method Overloading In Java
Java threads
Inheritance in java
Java abstract class & abstract methods
Abstract class
Classes, objects in JAVA
OOP java
Data Types & Variables in JAVA
Abstract Class Presentation
Inheritance in java
Basic Concepts of OOPs (Object Oriented Programming in Java)
Inheritance ppt
Strings in Java
Inner classes in java
Abstract Class & Abstract Method in Core Java
Access specifiers(modifiers) in java
Inheritance in Java
Ad

Similar to WHAT IS ABSTRACTION IN JAVA (20)

PPTX
When to use abstract class and methods in java
PPTX
06_OOVP.pptx object oriented and visual programming
PPTX
Abstract Class and Interface for Java Intoductory course.pptx
PDF
Java Interview Questions
PPTX
Lecture-on-Object-Oriented-Programming-Language-Java.pptx
DOCX
Java interface
PDF
Programming Laboratory Unit 1.pdf
PDF
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
PDF
20 most important java programming interview questions
PPTX
Abstract Class Presentation
PPTX
Interface in java ,multiple inheritance in java, interface implementation
PDF
How to Work with Java Interfaces and Abstract Classes
PPTX
Object+oriented+programming+in+java
PPTX
Chapter 8 java
PDF
Advanced Programming _Abstract Classes vs Interfaces (Java)
PDF
Automation testing real time interview question.pdf
PPT
PPT
Chapter 9 Interface
PPT
oops with java modules i & ii.ppt
When to use abstract class and methods in java
06_OOVP.pptx object oriented and visual programming
Abstract Class and Interface for Java Intoductory course.pptx
Java Interview Questions
Lecture-on-Object-Oriented-Programming-Language-Java.pptx
Java interface
Programming Laboratory Unit 1.pdf
ch4 foohggggvvbbhhhhhhhhhbbbbbbbbbbbbp.pdf
20 most important java programming interview questions
Abstract Class Presentation
Interface in java ,multiple inheritance in java, interface implementation
How to Work with Java Interfaces and Abstract Classes
Object+oriented+programming+in+java
Chapter 8 java
Advanced Programming _Abstract Classes vs Interfaces (Java)
Automation testing real time interview question.pdf
Chapter 9 Interface
oops with java modules i & ii.ppt
Ad

Recently uploaded (20)

PDF
LDMMIA Reiki Yoga S2 L3 Vod Sample Preview
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PDF
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
PDF
Sunset Boulevard Student Revision Booklet
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Insiders guide to clinical Medicine.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Introduction and Scope of Bichemistry.pptx
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PPTX
IMMUNIZATION PROGRAMME pptx
PDF
What Is Coercive Control? Understanding and Recognizing Hidden Abuse
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PDF
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Onica Farming 24rsclub profitable farm business
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
LDMMIA Reiki Yoga S2 L3 Vod Sample Preview
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
How to Manage Starshipit in Odoo 18 - Odoo Slides
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
Sunset Boulevard Student Revision Booklet
Open Quiz Monsoon Mind Game Prelims.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Insiders guide to clinical Medicine.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Introduction and Scope of Bichemistry.pptx
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
IMMUNIZATION PROGRAMME pptx
What Is Coercive Control? Understanding and Recognizing Hidden Abuse
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
Abdominal Access Techniques with Prof. Dr. R K Mishra
Onica Farming 24rsclub profitable farm business
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
UPPER GASTRO INTESTINAL DISORDER.docx

WHAT IS ABSTRACTION IN JAVA

  • 2.  Java abstraction or object-oriented programming is a way of separating the implementation of an interface and one of the five motifs,  along with encapsulation, inheritance, polymorphism, class, and object abstraction.
  • 3.  it is achieved using Java the interface and the abstract class in Java. An interface or abstract class is something that is not concrete,  something that is incomplete.
  • 4.  To use the interface or the abstract class, we need to extend and implement an abstract method with concrete behavior.  An example of abstraction is to create an interface to denote common behavior without specifying Details on how this example behavior works.
  • 5.  An interface called Server is created that has the start () and stop () method.  This is called the server abstraction because each server must have a way to start and stop and the details may be different.  As I said earlier, the Abstraction in Java is implemented using abstract classes and interfaces, as discussed in the next section.
  • 6.  In truth, which is an abstraction in Java, the difference between abstraction and encapsulation is also a very popular Java interview because the strong capacity of OOPS is one of the main requirements for Java developers.  Abstraction is also one of the concepts difficult to master. The programmer usually mixes different levels of abstraction that result in flexible code,
  • 7. If you want to use it, you need to make it complete or concrete, extending it. A class is called concrete if it does not contain any abstract method and implements the entire abstract method inherited from the abstract class or interface implemented. By the way, Java has a concept of abstract classes, abstract method, but a variable can not be abstract in Java.
  • 8.  A popular example of an abstract class in Java is the ActionListener, which has an abstract method called actionPerformed (ActionEvent ae).  This method is called when an ActionEvent is activated as when the JButton is clicked.
  • 9.  It is common in java to attach ActionListener with JButton by implementing the actionPerformed abstract method (ActionEvent a) using the anonymous class.  An abstract method in Java does not have the body, it is just a statement. To use an abstract method, it is necessary to replace this method in the subclass.  When you know that something needs to be there, you do not know exactly how it should be. For example.
  • 10. When I'm creating a class called Vehicle, I know there must be methods like start () and stop (), but I do not know how this start and stop method should work, since each vehicle can have different start and stop mechanism and .. g some they can be initiated by kicking or some can be by pressing buttons.
  • 11.  If you know some behavior during the creation of a class and this would remain common to all subclasses, add it to an abstract class.  An interface like the Runnable interface is a good example of Java abstraction that is used to abstract the tasks performed by multiple threads.  Callable is another good summary of a task that can return value.