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

What's hot (20)

PPT
Java Basics
shivamgarg_nitj
 
PPTX
Main method in java
Hitesh Kumar
 
PPT
java programming - applets
HarshithaAllu
 
PPTX
Spring boot
Pradeep Shanmugam
 
PPTX
Features of JAVA Programming Language.
Bhautik Jethva
 
PPT
06 abstract-classes
Anup Burange
 
PPT
Interface in java By Dheeraj Kumar Singh
dheeraj_cse
 
PPTX
this keyword in Java.pptx
ParvizMirzayev2
 
PPT
Exception Handling in JAVA
SURIT DATTA
 
PPT
Abstract class
Tony Nguyen
 
PPTX
JAVA ENVIRONMENT
josemachoco
 
PPSX
JDBC: java DataBase connectivity
Tanmoy Barman
 
PPS
Java Exception handling
kamal kotecha
 
PDF
Object-oriented Programming-with C#
Doncho Minkov
 
PPT
Java Basics
Brandon Black
 
PPSX
Introduction to java
Ajay Sharma
 
PPT
Unit I Advanced Java Programming Course
parveen837153
 
PPTX
Java string handling
Salman Khan
 
Java Basics
shivamgarg_nitj
 
Main method in java
Hitesh Kumar
 
java programming - applets
HarshithaAllu
 
Spring boot
Pradeep Shanmugam
 
Features of JAVA Programming Language.
Bhautik Jethva
 
06 abstract-classes
Anup Burange
 
Interface in java By Dheeraj Kumar Singh
dheeraj_cse
 
this keyword in Java.pptx
ParvizMirzayev2
 
Exception Handling in JAVA
SURIT DATTA
 
Abstract class
Tony Nguyen
 
JAVA ENVIRONMENT
josemachoco
 
JDBC: java DataBase connectivity
Tanmoy Barman
 
Java Exception handling
kamal kotecha
 
Object-oriented Programming-with C#
Doncho Minkov
 
Java Basics
Brandon Black
 
Introduction to java
Ajay Sharma
 
Unit I Advanced Java Programming Course
parveen837153
 
Java string handling
Salman Khan
 

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
What are Abstract Classes in Java | Edureka
Edureka!
 
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
 
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
 
What are Abstract Classes in Java | Edureka
Edureka!
 
‏‏‏‏‏‏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
 
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
 
Ad

Recently uploaded (20)

PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Horarios de distribución de agua en julio
pegazohn1978
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 

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