
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
Differences between abstract class and concrete class in Java
In Java, abstraction is achieved using Abstract classes and interfaces. An abstract class contains abstract methods which a child class. Following are the important differences between abstract class and a concrete class.
Sr. No. | Key | Abstract Class | Concrete Class |
---|---|---|---|
1 | Supported Methods | Abstract class can have both an abstract as well as concrete methods. | A concrete class can only have concrete methods. Even a single abstract method makes the class abstract. |
2 | Instantiation | Abstract class can not be instantiated using new keyword. | Concrete class can be instantiated using new keyword. |
3 | Abstract method | Abstract class may or may not have abstract methods. | Concrete clas can not have an abstract method. |
4 | Final | Abstract class can not be declared as a final class. | Concrete class can be declared final. |
5 | Keyword | Abstract class declared using abstract keyword. | Concrete class is not having abstract keyword during declaration. |
6 | Inheritance | Abstract class can inherit another class using extends keyword and implement an interface. | Interface can inherit only an inteface. |
7 | Interface | Abstract class can not implement an interface alone. A child class is needed to be able to use the interface for instantiation. | Interface can be implemented easily. |
Example of Abstract Class vs Concrete Class
JavaTester.java
public class JavaTester { public static void main(String args[]) { Cat lion = new Lion(); lion.eat(); } } abstract class Cat { abstract public void eat(); } class Lion extends Cat{ public void eat(){ System.out.println("Lion eats"); } }
Output
Lion eats
- Related Articles
- What is the difference between abstract class and a concrete class in Java?
- Differences between abstract class and interface in Java
- Difference between Abstract Class and Interface in Java
- Difference Between Interface and Abstract Class in Java & C#
- Abstract class in Java
- Differences between Interface and class in Java
- Difference between abstract class and interface
- Difference between Abstract Class and Interface in C#
- Difference between Abstract Class and Interface in C# Program
- Why Abstract Class is used in Java?
- Differences between anonymous class and lambda expression in Java?\n
- What are the differences between an Exception class and an Error class in Java?\n
- Can a class in Java be both final and abstract?
- Can we define an abstract class with no abstract methods in Java?
- Declare static variables and methods in an abstract class in Java

Advertisements