crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Difference between Abstract class and Interface in Java
Question Posted on 03 Mar 2020Home >> Java >> Java Questions >> Difference between Abstract class and Interface in Java

Difference between Abstract class and Interface in Java
Below are the 9 main difference between Abstract Class and Interface when we ask about Java

(1)Abstract Class:-We can extend abstract class by using keyword "extends".
Interface:-We can implement interface by using keyword "implements".

(2)Abstract Class:-Here in this class have class members like Private, protected etc.
Interface:-Members of interface are public in default.

(3)Abstract Class:-Abstract keyword is used to declare abstract class.
Interface:-Interface keyword is used to declare interface.

(4)Abstract Class:-Abstract class not support multiple inheritance.
Interface:-Interface have feature to support multiple inheritance.

(5)Abstract Class:-Abstract class have abstract and non-abstract methods.
Interface:-Interface have only abstract methods and it have default and static methods both.

(6)Abstract Class:-Abstract Class can have final, non-final, static and non-static variables.
Interface:-Interface has only static and final variables.

(7)Abstract Class:-Abstract class have features which can provide the implementation of interface.
Interface:-But interface cannot provide the implementation of abstract class.

(8)Abstract Class:-An abstract class can extend another Java class and implement multiple Java interfaces.
Interface:-An interface can extend another java interface only.

(9)Abstract Class:- Example:-
public abstract class WebSites
{
public abstract void site1();
}
Interface:- Example:-
Public interface Drawable
{
void draw();
}
0
0



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

What are the main difference between Array and Arraylist

What is classloader in Java and name of some classloader

Different modules of the Spring framework

Difference between Object and Class

Most important 15 aspects that Java Developer should learn in year 2020






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap