Abstract class vs Interface java

Published: 15 August 2020
on channel: Nariman Karimov
210
6

Abstract classes vs Interfaces in java

A simple example that demonstrates the use of both Abstract Classes and Interfaces. The two can be used in many different ways, either exclusively or in combination. We chose to keep them separate in order to demonstrate the main differences.

Multiple inheritance is not allowed in java and a class can only extend one parent

class. Interfaces provide a form of multiple inheritance. Interfaces are not classes,

however an interface can extend more than one parent interface.

Interfaces provide a form of multiple inheritance. A class can extend only one other class.

Interfaces are limited to public methods and constants with no implementation.

The abstract keyword is used to declare abstract class.

The interface keyword is used to declare interface.

Abstract class achieves partial abstraction (0 to 100%) whereas interface achieves fully abstraction (100%).

Java dərsləri
Subscribe:    / narimankarimov  


On this page of the site you can watch the video online Abstract class vs Interface java with a duration of hours minute second in good quality, which was uploaded by the user Nariman Karimov 15 August 2020, share the link with friends and acquaintances, this video has already been watched 210 times on youtube and it was liked by 6 viewers. Enjoy your viewing!