0% found this document useful (0 votes)
5 views5 pages

Diff Between Interface & Abstract Class

This document outlines the differences between interfaces and abstract classes in Java. It highlights key distinctions such as the nature of methods, inheritance support, variable modifiers, and initialization requirements. The objective is to help learners understand when to use interfaces versus abstract classes in application development.

Uploaded by

danushvarun11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Diff Between Interface & Abstract Class

This document outlines the differences between interfaces and abstract classes in Java. It highlights key distinctions such as the nature of methods, inheritance support, variable modifiers, and initialization requirements. The objective is to help learners understand when to use interfaces versus abstract classes in application development.

Uploaded by

danushvarun11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Application Development using

JAVA
(COURSE CODE: B18CS3105)

Differences between Interface & Abstract


class

Sri. [Link] RAO


Assistant Professor

Department of Computer Science and Engineering


SRKR Engineering College, Bhimavaram, A.P. - 534204
OBJECTIVES

The Objective of this lecture is

• To learn about the differences between


Interface and Abstract class in JAVA.
Differences between an Interface & Abstract class

Interface Abstract class

If we don’t know anything about If we are talking about


implementation and just we have implementation but not completely
requirement specification then we then we should go for abstract
go for interface. class.
Interface can have only abstract Abstract class can have both
methods. abstract and concrete methods.
It supports multiple inheritance It does not support multiple
inheritance.
we can not declare any other There are no restrictions on
modifier rather than public and abstract class method modifiers.
abstract for interface methods.
Every variable present inside Every variable present inside
interface is always public static final abstract class need not be public
whether we are declaring or not. static final.
Differences between an Interface & Abstract class

Interface Abstract class

We can not declare interface There are no restrictions on


variables other than public static abstract class variable modifiers.
final.
For interface variables compulsory For abstract class variables we are
we should perform initialization at not required to perform
the time of declaration only. initialization at the time of
Otherwise we will get compile time declaration.
error.
Interface can not have static Abstract class can have static
methods, main method and methods, main method and
constructor. constructor.
THANK YOU

You might also like