- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why do we use interfaces in Java?
An interface is a reference type in Java. It is similar to a class. It is a collection of abstract methods. A class implements AN interface, thereby inheritable the abstract ways of the interface.
An interface is a specification or a contract if a class implements an interface it indicates that class provides all the behaviors specified in that interface. In a way, it establishes communication between two objects.
Since Java does not support the concept multiple inheritance, an interface is used to achieve multiple inheritance.
- Related Articles
- Why do we use "use strict" in JavaScript?
- How can we use lambda expressions with functional interfaces in Java?
- Why do we use random.seed() in Python?
- Why do we use brackets in BODMAS?
- Why do we use pandas in python?
- Why do we use Convex Mirrors ?
- Why are interfaces introduced in Java?
- Why do we use comma operator in C#?
- Why do we use internal keyword in C#?
- Why do we use modifiers in C/C++?
- Why do we use restrict qualifier in C++?
- Why do we use const qualifier in C++?
- Why do we use JSON.stringify() method in jQuery?
- Why do we use DOCTYPES in HTML document?
- Why do we use salt in food preservation?

Advertisements