what is abstraction || abstract method in java ||

Published: 24 February 2024
on channel: LearningPointAabid
45
7

Abstraction in Java is a fundamental concept in object-oriented programming (OOP) that enables you to model real-world entities as classes and objects while hiding their complex implementation details.
A class which is declared with the abstract keyword is known as an abstract class in Java. It can have abstract and non-abstract methods (method with the body).
Abstraction is a process of hiding the implementation details and showing only functionality to the user.
Example:- it shows only essential things to the user and hides the internal details, for example, sending SMS where you type the text and send the message. You don't know the internal processing about the message delivery.

Rules for java Abstract class
An abstract class must be declared with an abstract keyword.
It can have abstract and non-abstract methods.
It cannot be instantiated.
It can have constructors and static methods also.
It can have final methods which will force the subclass not to change the body of the method.

A method which is declared as abstract and does not have implementation is known as an abstract method
Example: abstract void run();
Bike is an abstract class that contains only one abstract method run. Its implementation is provided by the Honda class


On this page of the site you can watch the video online what is abstraction || abstract method in java || with a duration of hours minute second in good quality, which was uploaded by the user LearningPointAabid 24 February 2024, share the link with friends and acquaintances, this video has already been watched 45 times on youtube and it was liked by 7 viewers. Enjoy your viewing!