Interfaces
Last updated
What is Interfaces?
In object-oriented programming (OOP), an interface is a contract or a set of methods that a class must implement. It defines a common set of methods that a class must provide, but it does not provide any implementation details. An interface can include both method signatures and constants.
Interfaces are used to define a common behavior for a group of related classes, and to provide a way for objects of different classes to be treated polymorphically. A class that implements an interface must provide an implementation for all of the methods declared in the interface. A class can implement multiple interfaces, but can only inherit from one base class.
Free resources to learn Interfaces
More in stage 4: Design Principles
Interfaces: common questions
Can I learn Interfaces in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Interfaces in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Interfaces tutorial for beginners?
It is lesson 43 of 94 in the free Software Design and Architecture roadmap, in stage 4, Design Principles. If you are new to Software Design and Architecture, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.