Top "Interface" questions

An interface refers to the designated point of interaction with a component.

Interfaces — What's the point?

The reason for interfaces truly eludes me. From what I understand, it is kind of a work around for the …

c# .net interface
In C#, can a class inherit from another class and an interface?

I want to know if a class can inherit from a class and an interface. The example code below doesn't …

c# class inheritance interface components
How do you find all subclasses of a given class in Java?

How does one go about and try to find all subclasses of a given class (or all implementors of a …

java class interface subclass
Why an abstract class implementing an interface can miss the declaration/implementation of one of the interface's methods?

A curious thing happens in Java when you use an abstract class to implement an interface: some of the interface's …

java interface abstract-class
Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?

Java doesn't allow multiple inheritance, but it allows implementing multiple interfaces. Why?

java oop inheritance interface language-design
Cast object to interface in TypeScript

I'm trying to make a cast in my code from the body of a request in express (using body-parser middleware) …

object typescript interface casting
How to extend a class in python?

In python how can you extend a class? For example if I have color.py class Color: def __init__(self, …

python class interface
How to check if an object implements an interface?

How to check if some class implements interface? When having: Character.Gorgon gor = new Character.Gorgon(); how to check if …

java oop interface
When to use: Java 8+ interface default method, vs. abstract method

Java 8 allows for default implementation of methods in interfaces called Default Methods. I am confused between when would I use …

java interface java-8 abstract-class default-method
Interface or an Abstract Class: which one to use?

Please explain when I should use a PHP interface and when I should use an abstract class? How I can …

php oop interface abstract-class