Skip to content

Some examples that show how Abstract Classes and Interfaces work in Java. I learned this on Edureka.

Notifications You must be signed in to change notification settings

guilhermelaviola/AbstractClassesAndInterfaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AbstractClassesAndInterfaces

Some examples that show how Abstract Classes and Interfaces work in Java. I learned this on Edureka.

What is an Abstract Class?

An abstract class is a class that is declared abstract —it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.

What is an Interface?

An interface is a reference type in Java. It is similar to class. It is a collection of abstract methods. A class implements an interface (or extends another class), thereby inheriting the abstract methods of the interface. image

Interfaces can only extend other interfaces. image

But what is difference between abstract class and interface?

The Abstract class and Interface both are used to have abstraction. An abstract class contains an abstract keyword on the declaration whereas an Interface is a sketch that is used to implement a class. image

About

Some examples that show how Abstract Classes and Interfaces work in Java. I learned this on Edureka.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages