1.

Distinguish between classes and interfaces in Java.

Answer»
ClassInterface
A class is a blueprint for the creation of objects with the same configuration for properties and methodsAn interface is a collection of properties and methods that HELPS to describe an object, but it does not provide implementation or INITIALIZATION for them
A class will have abstract or concrete methodsInterface will have abstract methods only. From Java 8 onwards, it supports static as well as default methods
Does not support multiple inheritance.Multiple Inheritance is supported
An interface can be implemented by a classInterface cannot be implemented by another interface, but it is possible to extend an interface
Using extends keyword, a class can be inherited from another classInterface cannot INHERIT a class, but it can inherit an interface
It can have all types of members(PUBLIC, private or, OTHERS)Members are public by default, but you can use other access specifiers also for the interface members


Discussion

No Comment Found