SlideShare a Scribd company logo
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
WHY WE NEED ABSTRACT CLASSES IN JAVA?
RULES FOR ABSTRACT CLASSES IN JAVA
www.edureka.co
WHAT ARE ABSTRACT CLASSES IN JAVA?
WAYS TO ACHIEVE ABSTRACTION IN JAVA
THE SYNTAX FOR ABSTRACTION IN JAVA
PRACTICAL EXAMPLES OF ABSTRACT CLASSES
ABSTRACT CLASS VERSUS INTERFACE
WHAT ARE ABSTRACT CLASSES IN JAVA?
www.edureka.co
WHAT ARE ABSTRACT CLASSES IN JAVA?
www.edureka.co
Abstract Classes in Java act as a boundary between the
implementation method and its functionality. It is used to
exchange the functionality between the Concrete class
members and the Abstract Class method.
WHY WE NEED ABSTRACT CLASSES IN JAVA?
www.edureka.co
Dynamic Method Resolution
Loose Coupling
Separates Method Definition Code Reuseability
Template
Default Functionality
WHY WE NEED ABSTRACT CLASSES IN JAVA?
www.edureka.co
RULES FOR ABSTRACT CLASSES IN JAVA
www.edureka.co
It can have Constructors and Static Methods also
It can have Abstract and Non-Abstract Methods
An Abstract Class must be declared using Abstract Keyword
It can have Final Methods
It cannot be Instantiated
RULES FOR ABSTRACT CLASSES IN JAVA
www.edureka.co
WAYS TO ACHIEVE ABSTRACTION IN JAVA
www.edureka.co
WAYS TO ACHIEVE ABSTRACTION IN JAVA
The process of Abstraction in Java can be achieved by the
following two methods as mentioned below:
1. Implementing an Abstract Class
2. Implementing an Interface
www.edureka.co
SYNTAX FOR ABSTRACTION IN JAVA
www.edureka.co
SYNTAX FOR ABSTRACTION IN JAVA
www.edureka.co
Abstract Class:
abstract class edureka{}
Abstract Method:
abstract class method();
PRACTICAL EXAMPLES FOR ABSTRACT CLASS
www.edureka.co
STUDENT INFORMATION
www.edureka.co
AREA OF RECTANGLE AND CIRCLE
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Abstract Class can have Abstract and Non-Abstract methods
Interface can have only Abstract Methods
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Abstract Class includes Non-Final Variables
Interface has only Final Variables
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Abstract class has Static, Non-Static, final, Non-Final variables
Interface has Static and Final variables only
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Abstract class can implement an Interface
Interface will not implement the Abstract Class
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Abstract class is implemented using “extends” Keyword
Interface is implemented using “implements” Keyword
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Abstract classes can extend Java Classes and Interfaces
Interface can extend only an Interface
www.edureka.co
ABSTRACT CLASS VERSUS INTERFACE
Members can be Private and Protected in an Abstract Class
Members are Public by default in an Interface
www.edureka.co
What are Abstract Classes in Java | Edureka
www.edureka.co

More Related Content

PPTX
Abstract Class Presentation
PPT
ABSTRACT CLASSES AND INTERFACES.ppt
PPT
Abstract class in java
PPTX
Interfaces in java
PPTX
INHERITANCE IN JAVA.pptx
PPTX
Access modifier and inheritance
PPTX
This keyword in java
PPTX
File handling
Abstract Class Presentation
ABSTRACT CLASSES AND INTERFACES.ppt
Abstract class in java
Interfaces in java
INHERITANCE IN JAVA.pptx
Access modifier and inheritance
This keyword in java
File handling

What's hot (20)

PPT
Inheritance in java
PPTX
Polymorphism presentation in java
PPTX
Abstraction in java
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PPTX
java interface and packages
PPTX
Operators in java presentation
PPTX
Abstract Class & Abstract Method in Core Java
PPTX
Classes, objects in JAVA
PDF
Polymorphism In Java
PPTX
Abstract class and Interface
PDF
Java I/o streams
PPT
PPTX
I/O Streams
PPTX
Static Members-Java.pptx
PPTX
Methods in java
PPTX
Java Method, Static Block
PPTX
Introduction to java
PPT
06 abstract-classes
PPT
Super and final in java
PPTX
oops concept in java | object oriented programming in java
Inheritance in java
Polymorphism presentation in java
Abstraction in java
Oops concepts || Object Oriented Programming Concepts in Java
java interface and packages
Operators in java presentation
Abstract Class & Abstract Method in Core Java
Classes, objects in JAVA
Polymorphism In Java
Abstract class and Interface
Java I/o streams
I/O Streams
Static Members-Java.pptx
Methods in java
Java Method, Static Block
Introduction to java
06 abstract-classes
Super and final in java
oops concept in java | object oriented programming in java
Ad

Similar to What are Abstract Classes in Java | Edureka (20)

PDF
Java abstract Keyword.pdf
PPTX
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
PPTX
06_OOVP.pptx object oriented and visual programming
PPT
Ppt chapter10
PPTX
Java ocjp level_2
PPT
Oo abap-sap-1206973306636228-5
PPT
Abap Inicio
PPTX
Java 6.pptx
PDF
Abstraction in Java: Abstract class and Interfaces
PPTX
Abstraction in java.pptx
PDF
Abstract classes and Methods in java
PPTX
Abstraction encapsulation inheritance polymorphism
PDF
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
PDF
How to Work with Java Interfaces and Abstract Classes
PPTX
Abstraction in java [abstract classes and Interfaces
PPTX
Lecture-on-Object-Oriented-Programming-Language-Java.pptx
PPT
9 abstract interface
PPTX
what is differance between abstract class and interface ppt
PDF
Lecture 10
Java abstract Keyword.pdf
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
06_OOVP.pptx object oriented and visual programming
Ppt chapter10
Java ocjp level_2
Oo abap-sap-1206973306636228-5
Abap Inicio
Java 6.pptx
Abstraction in Java: Abstract class and Interfaces
Abstraction in java.pptx
Abstract classes and Methods in java
Abstraction encapsulation inheritance polymorphism
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
How to Work with Java Interfaces and Abstract Classes
Abstraction in java [abstract classes and Interfaces
Lecture-on-Object-Oriented-Programming-Language-Java.pptx
9 abstract interface
what is differance between abstract class and interface ppt
Lecture 10
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
PDF
Top 5 Trending Business Intelligence Tools | Edureka
PDF
Tableau Tutorial for Data Science | Edureka
PDF
Python Programming Tutorial | Edureka
PDF
Top 5 PMP Certifications | Edureka
PDF
Top Maven Interview Questions in 2020 | Edureka
PDF
Linux Mint Tutorial | Edureka
PDF
How to Deploy Java Web App in AWS| Edureka
PDF
Importance of Digital Marketing | Edureka
PDF
RPA in 2020 | Edureka
PDF
Email Notifications in Jenkins | Edureka
PDF
EA Algorithm in Machine Learning | Edureka
PDF
Cognitive AI Tutorial | Edureka
PDF
AWS Cloud Practitioner Tutorial | Edureka
PDF
Blue Prism Top Interview Questions | Edureka
PDF
Big Data on AWS Tutorial | Edureka
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
PDF
Kubernetes Installation on Ubuntu | Edureka
PDF
Introduction to DevOps | Edureka
What to learn during the 21 days Lockdown | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Tableau Tutorial for Data Science | Edureka
Python Programming Tutorial | Edureka
Top 5 PMP Certifications | Edureka
Top Maven Interview Questions in 2020 | Edureka
Linux Mint Tutorial | Edureka
How to Deploy Java Web App in AWS| Edureka
Importance of Digital Marketing | Edureka
RPA in 2020 | Edureka
Email Notifications in Jenkins | Edureka
EA Algorithm in Machine Learning | Edureka
Cognitive AI Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Blue Prism Top Interview Questions | Edureka
Big Data on AWS Tutorial | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Kubernetes Installation on Ubuntu | Edureka
Introduction to DevOps | Edureka

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Electronic commerce courselecture one. Pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Empathic Computing: Creating Shared Understanding
Group 1 Presentation -Planning and Decision Making .pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
20250228 LYD VKU AI Blended-Learning.pptx
Machine Learning_overview_presentation.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
MIND Revenue Release Quarter 2 2025 Press Release
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Weekly Chronicles - August'25-Week II
Empathic Computing: Creating Shared Understanding

What are Abstract Classes in Java | Edureka

  • 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  • 2. WHY WE NEED ABSTRACT CLASSES IN JAVA? RULES FOR ABSTRACT CLASSES IN JAVA www.edureka.co WHAT ARE ABSTRACT CLASSES IN JAVA? WAYS TO ACHIEVE ABSTRACTION IN JAVA THE SYNTAX FOR ABSTRACTION IN JAVA PRACTICAL EXAMPLES OF ABSTRACT CLASSES ABSTRACT CLASS VERSUS INTERFACE
  • 3. WHAT ARE ABSTRACT CLASSES IN JAVA? www.edureka.co
  • 4. WHAT ARE ABSTRACT CLASSES IN JAVA? www.edureka.co Abstract Classes in Java act as a boundary between the implementation method and its functionality. It is used to exchange the functionality between the Concrete class members and the Abstract Class method.
  • 5. WHY WE NEED ABSTRACT CLASSES IN JAVA? www.edureka.co
  • 6. Dynamic Method Resolution Loose Coupling Separates Method Definition Code Reuseability Template Default Functionality WHY WE NEED ABSTRACT CLASSES IN JAVA? www.edureka.co
  • 7. RULES FOR ABSTRACT CLASSES IN JAVA www.edureka.co
  • 8. It can have Constructors and Static Methods also It can have Abstract and Non-Abstract Methods An Abstract Class must be declared using Abstract Keyword It can have Final Methods It cannot be Instantiated RULES FOR ABSTRACT CLASSES IN JAVA www.edureka.co
  • 9. WAYS TO ACHIEVE ABSTRACTION IN JAVA www.edureka.co
  • 10. WAYS TO ACHIEVE ABSTRACTION IN JAVA The process of Abstraction in Java can be achieved by the following two methods as mentioned below: 1. Implementing an Abstract Class 2. Implementing an Interface www.edureka.co
  • 11. SYNTAX FOR ABSTRACTION IN JAVA www.edureka.co
  • 12. SYNTAX FOR ABSTRACTION IN JAVA www.edureka.co Abstract Class: abstract class edureka{} Abstract Method: abstract class method();
  • 13. PRACTICAL EXAMPLES FOR ABSTRACT CLASS www.edureka.co
  • 15. AREA OF RECTANGLE AND CIRCLE www.edureka.co
  • 16. ABSTRACT CLASS VERSUS INTERFACE www.edureka.co
  • 17. ABSTRACT CLASS VERSUS INTERFACE Abstract Class can have Abstract and Non-Abstract methods Interface can have only Abstract Methods www.edureka.co
  • 18. ABSTRACT CLASS VERSUS INTERFACE Abstract Class includes Non-Final Variables Interface has only Final Variables www.edureka.co
  • 19. ABSTRACT CLASS VERSUS INTERFACE Abstract class has Static, Non-Static, final, Non-Final variables Interface has Static and Final variables only www.edureka.co
  • 20. ABSTRACT CLASS VERSUS INTERFACE Abstract class can implement an Interface Interface will not implement the Abstract Class www.edureka.co
  • 21. ABSTRACT CLASS VERSUS INTERFACE Abstract class is implemented using “extends” Keyword Interface is implemented using “implements” Keyword www.edureka.co
  • 22. ABSTRACT CLASS VERSUS INTERFACE Abstract classes can extend Java Classes and Interfaces Interface can extend only an Interface www.edureka.co
  • 23. ABSTRACT CLASS VERSUS INTERFACE Members can be Private and Protected in an Abstract Class Members are Public by default in an Interface www.edureka.co