SlideShare a Scribd company logo
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beginners | Simplilearn
What is an Abstract Class?
Features of Abstract Classes
Rules to declare Abstract Classes
Procedure to achieve Abstraction in Java
The Syntax for Abstract Classes
Examples for Abstract Classes
Advantages of Abstract Classes
Disadvantages of Abstract Classes
Interface v/s Abstract Class
Interface
Agenda
What Is an Abstract Class?
Click here to watch the video
What Is an Abstract Class?
Abstract class in Java is considered as a template of
methods and variables used in a program. Abstract classes
cannot be instantiated directly.
Features of Abstract Classes
Features of Abstract class
Template
Loose Coupling
Code Reusability
Abstraction
Dynamic Resolution
Rules to Declare an Abstract Class
Rules to Declare an Abstract Class
• The keyword “abstract” is mandatory.
• Abstract classes cannot be instantiated.
• An abstract class must have at least one abstract method.
• An abstract class includes final methods.
• An abstract class may also include non-abstract methods.
• Abstract class can include constructors and static methods.
Procedure to Achieve Abstraction
Procedure
Procedure to Achieve Abstraction
Abstraction is one of the fundamentals of Object-oriented
programming. Abstraction can be achieved by following either of the
two below mentioned procedures.
• Using an Interface
• Using an Abstract Class
Procedure
The Syntax for Abstract Classes
Syntax of Abstract Class
Abstraction can be achieved by following the syntax mentioned below.
abstract class Simplilearn{}
abstract void Simplilearn();
Interface
Interface
Interface can be defined as a boundary between the method and the class
implementing it. In Java, we use interface to achieve abstraction
Syntax of Interface
Abstraction can be achieved by following the syntax mentioned below.
interface Simplilearn{}
Examples for Abstract Classes
Interface V/S Abstract ClassI
Interface V/S Abstract Class
I
Interface Abstract
Keyword: interface Keyword: abstract
Subclasses extend it Subclasses implement it
Only one abstract class
can be extended
Multiple interfaces can be
implemented
Supports multiple
inheritance
Does not support
multiple inheritance
Advantages of Abstract Classes
Advantages of Abstract Class
• Highly beneficial in writing shorter codes
• Avoids code duplication
• Enables code Reusability
• Changes to Internal code implementation is done without affecting
classes
Disadvantages of Abstract Classes
Disadvantages of Abstract Class
• Abstraction is expensive as sometimes you need to handle cases and
situation which are not necessary sometimes.
• Object relational impedance mismatch in case of RDBMS
• Object relational Mapping in case of Frameworks like hibernate
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beginners | Simplilearn

More Related Content

PPT
06 abstract-classes
Anup Burange
 
PDF
What are Abstract Classes in Java | Edureka
Edureka!
 
PPT
Adapter pattern
Shakil Ahmed
 
PPTX
Open Closed Principle kata
Paul Blundell
 
PPTX
Aspect Oriented Programming
Rajesh Ganesan
 
PPTX
Let us understand design pattern
Mindfire Solutions
 
PPT
Unit 7 Java
arnold 7490
 
PPT
Java And Multithreading
Shraddha
 
06 abstract-classes
Anup Burange
 
What are Abstract Classes in Java | Edureka
Edureka!
 
Adapter pattern
Shakil Ahmed
 
Open Closed Principle kata
Paul Blundell
 
Aspect Oriented Programming
Rajesh Ganesan
 
Let us understand design pattern
Mindfire Solutions
 
Unit 7 Java
arnold 7490
 
Java And Multithreading
Shraddha
 

What's hot (20)

PPTX
The Singleton Pattern Presentation
JAINIK PATEL
 
PPTX
Semi join
Alokeparna Choudhury
 
PPTX
Inyección de dependencias en Node.js con InversifyJS & TypeScript
Remo Jansen
 
PDF
Design patterns difference between interview questions
Umar Ali
 
PPT
Singleton design pattern
11prasoon
 
PPTX
Basics of Java Concurrency
kshanth2101
 
PDF
AWS Black Belt Online Seminar 2017 Docker on AWS
Amazon Web Services Japan
 
PDF
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
Amazon Web Services Japan
 
PPTX
Methods for handling deadlock
sangrampatil81
 
PPTX
input buffering in lexical analysis in CD
HeadOfDepartmentComp1
 
PPTX
Presentation on Segmentation
Priyanka bisht
 
PPTX
Java swing
Apurbo Datta
 
PPT
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
PPTX
Java applet - java
Rubaya Mim
 
PDF
Laravel管理画面ジェネレーター
Takuya Tejima
 
PPTX
8 drived horizontal fragmentation
Mohsan Ijaz
 
PPT
Web engineering - MVC
Nosheen Qamar
 
PPTX
Patterns
Amith Tiwari
 
PPTX
Design Goals of Distributed System
Ashish KC
 
PDF
AWS Black Belt Online Seminar 2017 Amazon Aurora
Amazon Web Services Japan
 
The Singleton Pattern Presentation
JAINIK PATEL
 
Inyección de dependencias en Node.js con InversifyJS & TypeScript
Remo Jansen
 
Design patterns difference between interview questions
Umar Ali
 
Singleton design pattern
11prasoon
 
Basics of Java Concurrency
kshanth2101
 
AWS Black Belt Online Seminar 2017 Docker on AWS
Amazon Web Services Japan
 
AWS Lambda ハンズオン 2-Tier アーキテクチャで未来へ
Amazon Web Services Japan
 
Methods for handling deadlock
sangrampatil81
 
input buffering in lexical analysis in CD
HeadOfDepartmentComp1
 
Presentation on Segmentation
Priyanka bisht
 
Java swing
Apurbo Datta
 
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
Java applet - java
Rubaya Mim
 
Laravel管理画面ジェネレーター
Takuya Tejima
 
8 drived horizontal fragmentation
Mohsan Ijaz
 
Web engineering - MVC
Nosheen Qamar
 
Patterns
Amith Tiwari
 
Design Goals of Distributed System
Ashish KC
 
AWS Black Belt Online Seminar 2017 Amazon Aurora
Amazon Web Services Japan
 
Ad

Similar to Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beginners | Simplilearn (20)

PPTX
Abstraction in java.pptx
AsifMulani17
 
PPTX
Java 6.pptx
usmanusman720379
 
PDF
Abstraction in Java: Abstract class and Interfaces
Jamsher bhanbhro
 
PDF
‏‏‏‏‏‏oop lecture 6_١٢٥٩٤٧taiz univercity.pdf
nabeehmohammedtaher
 
PPTX
More oop in java
SAGARDAVE29
 
PPTX
06_OOVP.pptx object oriented and visual programming
deffa5
 
PPTX
Unit II Inheritance ,Interface and Packages.pptx
pranalisonawane8600
 
PPTX
OBJECT ORIENTED PROGRAMMING Unit2 second half.pptx
AnujaS24
 
PDF
Java abstract Keyword.pdf
SudhanshiBakre1
 
PPT
12.2 Abstract class and Interface.ppt
VISHNUSHANKARSINGH3
 
PPTX
Interfaces in java
Shiv Mehmi
 
PPTX
Abstraction encapsulation inheritance polymorphism
PriyadharshiniG41
 
PPTX
what is differance between abstract class and interface ppt
manojsharma469262
 
PDF
JAVA PROGRAMMING – Packages - Stream based I/O
Jyothishmathi Institute of Technology and Science Karimnagar
 
PPTX
Java interfaces
Elizabeth alexander
 
PPTX
Exception handling in ASP .NET
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Raffi Khatchadourian
 
PDF
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
Edureka!
 
Abstraction in java.pptx
AsifMulani17
 
Java 6.pptx
usmanusman720379
 
Abstraction in Java: Abstract class and Interfaces
Jamsher bhanbhro
 
‏‏‏‏‏‏oop lecture 6_١٢٥٩٤٧taiz univercity.pdf
nabeehmohammedtaher
 
More oop in java
SAGARDAVE29
 
06_OOVP.pptx object oriented and visual programming
deffa5
 
Unit II Inheritance ,Interface and Packages.pptx
pranalisonawane8600
 
OBJECT ORIENTED PROGRAMMING Unit2 second half.pptx
AnujaS24
 
Java abstract Keyword.pdf
SudhanshiBakre1
 
12.2 Abstract class and Interface.ppt
VISHNUSHANKARSINGH3
 
Interfaces in java
Shiv Mehmi
 
Abstraction encapsulation inheritance polymorphism
PriyadharshiniG41
 
what is differance between abstract class and interface ppt
manojsharma469262
 
JAVA PROGRAMMING – Packages - Stream based I/O
Jyothishmathi Institute of Technology and Science Karimnagar
 
Java interfaces
Elizabeth alexander
 
Exception handling in ASP .NET
baabtra.com - No. 1 supplier of quality freshers
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at ICSE...
Raffi Khatchadourian
 
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
Edureka!
 
Ad

More from Simplilearn (20)

PPTX
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Simplilearn
 
PPTX
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Simplilearn
 
PPTX
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Simplilearn
 
PPTX
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
Simplilearn
 
PPTX
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
Simplilearn
 
PPTX
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
Simplilearn
 
PPTX
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Simplilearn
 
PPTX
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
Simplilearn
 
PPTX
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
Simplilearn
 
PPTX
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
PPTX
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
PPTX
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Simplilearn
 
PPTX
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Simplilearn
 
PPTX
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Simplilearn
 
PPTX
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
Simplilearn
 
PPTX
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Simplilearn
 
PPTX
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Simplilearn
 
PPTX
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Simplilearn
 
PPTX
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
PPTX
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
Top 50 Scrum Master Interview Questions | Scrum Master Interview Questions & ...
Simplilearn
 
Bagging Vs Boosting In Machine Learning | Ensemble Learning In Machine Learni...
Simplilearn
 
Future Of Social Media | Social Media Trends and Strategies 2025 | Instagram ...
Simplilearn
 
SQL Query Optimization | SQL Query Optimization Techniques | SQL Basics | SQL...
Simplilearn
 
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
Simplilearn
 
How To Start Influencer Marketing Business | Influencer Marketing For Beginne...
Simplilearn
 
Cyber Security Roadmap 2025 | How To Become Cyber Security Engineer In 2025 |...
Simplilearn
 
How To Become An AI And ML Engineer In 2025 | AI Engineer Roadmap | AI ML Car...
Simplilearn
 
What Is GitHub Copilot? | How To Use GitHub Copilot? | How does GitHub Copilo...
Simplilearn
 
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 
Top 7 High Paying AI Certifications Courses For 2025 | Best AI Certifications...
Simplilearn
 
Data Cleaning In Data Mining | Step by Step Data Cleaning Process | Data Clea...
Simplilearn
 
Top 10 Data Analyst Projects For 2025 | Data Analyst Projects | Data Analysis...
Simplilearn
 
AI Engineer Roadmap 2025 | AI Engineer Roadmap For Beginners | AI Engineer Ca...
Simplilearn
 
Machine Learning Roadmap 2025 | Machine Learning Engineer Roadmap For Beginne...
Simplilearn
 
Kotter's 8-Step Change Model Explained | Kotter's Change Management Model | S...
Simplilearn
 
Gen AI Engineer Roadmap For 2025 | How To Become Gen AI Engineer In 2025 | Si...
Simplilearn
 
Top 10 Data Analyst Certification For 2025 | Best Data Analyst Certification ...
Simplilearn
 
Complete Data Science Roadmap For 2025 | Data Scientist Roadmap For Beginners...
Simplilearn
 

Recently uploaded (20)

DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 

Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beginners | Simplilearn

  • 2. What is an Abstract Class? Features of Abstract Classes Rules to declare Abstract Classes Procedure to achieve Abstraction in Java The Syntax for Abstract Classes Examples for Abstract Classes Advantages of Abstract Classes Disadvantages of Abstract Classes Interface v/s Abstract Class Interface Agenda
  • 3. What Is an Abstract Class?
  • 4. Click here to watch the video
  • 5. What Is an Abstract Class? Abstract class in Java is considered as a template of methods and variables used in a program. Abstract classes cannot be instantiated directly.
  • 7. Features of Abstract class Template Loose Coupling Code Reusability Abstraction Dynamic Resolution
  • 8. Rules to Declare an Abstract Class
  • 9. Rules to Declare an Abstract Class • The keyword “abstract” is mandatory. • Abstract classes cannot be instantiated. • An abstract class must have at least one abstract method. • An abstract class includes final methods. • An abstract class may also include non-abstract methods. • Abstract class can include constructors and static methods.
  • 10. Procedure to Achieve Abstraction Procedure
  • 11. Procedure to Achieve Abstraction Abstraction is one of the fundamentals of Object-oriented programming. Abstraction can be achieved by following either of the two below mentioned procedures. • Using an Interface • Using an Abstract Class Procedure
  • 12. The Syntax for Abstract Classes
  • 13. Syntax of Abstract Class Abstraction can be achieved by following the syntax mentioned below. abstract class Simplilearn{} abstract void Simplilearn();
  • 15. Interface Interface can be defined as a boundary between the method and the class implementing it. In Java, we use interface to achieve abstraction
  • 16. Syntax of Interface Abstraction can be achieved by following the syntax mentioned below. interface Simplilearn{}
  • 19. Interface V/S Abstract Class I Interface Abstract Keyword: interface Keyword: abstract Subclasses extend it Subclasses implement it Only one abstract class can be extended Multiple interfaces can be implemented Supports multiple inheritance Does not support multiple inheritance
  • 21. Advantages of Abstract Class • Highly beneficial in writing shorter codes • Avoids code duplication • Enables code Reusability • Changes to Internal code implementation is done without affecting classes
  • 23. Disadvantages of Abstract Class • Abstraction is expensive as sometimes you need to handle cases and situation which are not necessary sometimes. • Object relational impedance mismatch in case of RDBMS • Object relational Mapping in case of Frameworks like hibernate