Techoceanhub logo

Abstraction in Java

Abstraction is the process of hiding the implementation details and  showing the required functionality to the user.

In Java abstraction is achieved through abstract classes and interfaces.

Some Features of abstract classes.

  1. In abstract class there are both abstract and non abstract methods.
  2. These classes cannot be instantiated.
  3. These classes  uses abstract keyword in order to declare a class as abstract.
  4. Abstract classes also uses extend keyword like normal classes.

Some features of Interfaces.

  1. All the methods in interface are by default abstract, you don’t have to declare it as abstract.
  2. Methods in interfaces are implicitly public.
  3. For extending an interface we have to use implements keyword.
  4. We can extend many interfaces using “implements” keyword however, we can only extend one class.

For your further understanding I have  also added a video .

Feel free to comment and subscribe.

Share:

Categories

Archives

Related Posts

Array Destructuring

Array Destructuring Array destructuring is a powerful syntax introduced in ES6 that allows you to unpack elements from an array

Read More »

Explore our Affiliated partner links

hostgator website plan

Hostgator

Best Website hosting plans & Best for 24/7 support.

hostinger webhosting plan

Hostinger

Reasonable website hosting packages for small business & 24/7 Email support

Elementor pro

Design Worpdress website quickly using Elementor Builder and AI

buy elementor website templates

Buy Elementor Website Template

Buy ready made Elementor Website Template from us & Get Free Elementor pro licence for 1 year .