Загрузка страницы

TOP 6 difference between Abstract class and Interface in JAVA || Must know facts

This tutorial covers the difference between abstract class and interface.As we go further with this tutorial we are going to learn the top 6 difference when we compare interface vs abstract class in java.

First Lets talk about what is interface in java and what is the use of interface in java ?

So when we know the specification but not aware of the implementation, then we should go for an interface.

Then the next question will be what is abstract class in java and what is the use of abstract class in java ?

The answer is very simple, When we know the partial implementation then we should prefer abstract class.

I will try to demonstrate you the difference between interface and abstract class with a simple example with this tutorial.

——————

The abstract keyword is used to create an abstract class whereas interface keyword is used to create an interface.

------------------

The variable of an abstract class can have final, non-final, static and non-static variables whereas the variable of an interface should be always public static final.

————————

Another difference between abstract class and interface in java is :
we can achieve multiple inheritances by using interface whereas with an abstract class it is not possible as multiple inheritance is not supported by java.

——————————

An interface can’t have a constructor within it whereas the abstract class can have a constructor within it.know all the reasons why the abstract class does contain a constructor, you can follow the below tutorial by clicking on the link :

[

Why we need constructor inside an abstract class ? || Popular Java interview question

https://youtu.be/jmxOsCGV120

———————————

An interface in java can have an only abstract method within it whereas the abstract class in java can have both abstract and concrete method within it.
(FYI: from java 8 we can have both concert and abstract method within an interface )

To know more, watch this tutorial :

INTERFACE IN JAVA 8 with REAL TIME code ||Why DEFAULT Method?[Explained]

https://youtu.be/rjQ0XxcQlFw
——————————————

Well, we can have few more differences as well but these are the few common difference between abstract class and interface in java that each developer should
aware of.

-------

Please subscribe to my channel by clicking on the link below.

https://www.youtube.com/channel/UCpUYkSDJpHug-vfC5S-NXRA?sub_confirmation=1

Stay tuned and like my Facebook page for more.
https://www.facebook.com/seleniumexpress/
Music :
-----------
credits : -

Adventures by A Himitsu https://soundcloud.com/a-himitsu
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
http://creativecommons.org/licenses/b...
Music released by Argofox https://youtu.be/8BXNwnxaVQE
Music provided by Audio Library https://youtu.be/MkNeIUgNPQ8
-----

intro template :
wwww.youtube.com/Alexbau01

Видео TOP 6 difference between Abstract class and Interface in JAVA || Must know facts канала Selenium Express
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
1 декабря 2017 г. 8:38:28
00:17:48
Другие видео канала
#17 Faster page load with minified CSS? Java website development tutorial | Spring+Java live project#17 Faster page load with minified CSS? Java website development tutorial | Spring+Java live projectCoding Game Over feature using Spring boot + Java + Javascript | Spring boot project challenge 5 & 6Coding Game Over feature using Spring boot + Java + Javascript | Spring boot project challenge 5 & 6Can we specify varargs as the first parameter of a method ? | variable length argument in javaCan we specify varargs as the first parameter of a method ? | variable length argument in javawill resume shortly...will resume shortly...JAVA Microservices pattern - How EUREKA works internally ? | Service Discovery | Spring Cloud #7JAVA Microservices pattern - How EUREKA works internally ? | Service Discovery | Spring Cloud #75 JAVA ERRORS you should learn today ( NoClassDefFoundError) | JVM architecture - ClassLoader5 JAVA ERRORS you should learn today ( NoClassDefFoundError) | JVM architecture - ClassLoaderSpring Security Users & Authorities schema | JdbcUserDetailsManager tech walkthrough   | #6Spring Security Users & Authorities schema | JdbcUserDetailsManager tech walkthrough | #6Spring Boot Project Challenge #4 : Solve this array puzzle using Java  & Spring  BootSpring Boot Project Challenge #4 : Solve this array puzzle using Java & Spring BootSpring Security Master Class - Configure HttpSecurity | User Authentication & Authorization #4Spring Security Master Class - Configure HttpSecurity | User Authentication & Authorization #4Java Variables and Datatypes || Beginners First Step to programmingJava Variables and Datatypes || Beginners First Step to programmingSpring Security Master class - Setting Up User Registration | spring security tutorial | Ep #5Spring Security Master class - Setting Up User Registration | spring security tutorial | Ep #5#13 Full Stack : Developing the delete link | Spring MySQL CRUD | Java + spring Live project#13 Full Stack : Developing the delete link | Spring MySQL CRUD | Java + spring Live projectJava Stream API : What is a Short Circuiting Stateful Intermediate Operation ? | Java 8 sort() | EP3Java Stream API : What is a Short Circuiting Stateful Intermediate Operation ? | Java 8 sort() | EP3Getting started with java interview questions ( Varargs in java ) ||  case 1Getting started with java interview questions ( Varargs in java ) || case 1How One to One bidirectional mapping works in Spring Data JPA ? | spring boot | HibernateHow One to One bidirectional mapping works in Spring Data JPA ? | spring boot | HibernateJava Method Reference & Stream API :  Learn to Write Clean CodeJava Method Reference & Stream API : Learn to Write Clean CodeMastering Spring Boot : From Beginners to Pro | Build Your 1st SpringBoot App | spring boot tutorialMastering Spring Boot : From Beginners to Pro | Build Your 1st SpringBoot App | spring boot tutorial[INTERMEDIATE] Spring MVC Course Preview || Road map || Application Walkthrough[INTERMEDIATE] Spring MVC Course Preview || Road map || Application WalkthroughJava Interview Shorts 3 -  What is an Entry object ? || Java collections #javainterviewquestionsJava Interview Shorts 3 - What is an Entry object ? || Java collections #javainterviewquestionsComprable : behind the scene [debugging] | Java Collection Framework | Collection.sort() | #6Comprable : behind the scene [debugging] | Java Collection Framework | Collection.sort() | #6#8 Backend: Save Student | Spring CRUD example with MySQL | Java + spring Live project#8 Backend: Save Student | Spring CRUD example with MySQL | Java + spring Live project
Яндекс.Метрика