Java - Difference between an Abstract class and Interface

Difference between an Abstract class and Interface.

An abstract class can have both abstract and concrete methods whereas an interface can have only method signatures.

An abstract class is to be extended by another class, where as an interface is to be implemented in another class.

A class can extend only one abstract class, whereas a class can implement multiple interfaces.

By default, all the methods are abstract and public in interface, whereas in abstract class, the key words public and abstract are to be explicitly specified in an abstract class.
What is singleton class? Where is it used?
What is singleton class? Where is it used? - A class is defined as singleton class, if and only if it can create only one object. This class is useful when.....
Difference between a public and a non-public class
Difference between a public and a non-public class - A class with access specifier ‘public’ can be accessed across the packages. A package is like a folder in GUI....
What is Bootstrap, Extension and System Class loader in Java?
What is Bootstrap, Extension and System Class loader? - The Bootstrap class loader loads key Java classes. Bootstrap class loader loads the basic classes from......
Post your comment