what is abstraction || abstract method in java ||

Pubblicato il: 24 febbraio 2024
sul canale di: 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


In questa pagina del sito puoi guardare il video online what is abstraction || abstract method in java || della durata di ore minuti seconda in buona qualità , che l'utente ha caricato LearningPointAabid 24 febbraio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 45 volte e gli è piaciuto 7 spettatori. Buona visione!