I haven’t touched Java since using JBuilder in the late 90’s while at University, so I’m a little out of touch – at any rate I’ve been working on...
I’ve been trying to study up on PHP lately, and I find myself getting hung up on traits. I understand the concept of horizontal code reuse and not wanting...
What is the simplest way of testing if an object implements a given interface in C#? (Answer to this question in Java) 14 Answers 14
I noticed that with the optional parameters in C# 4 if you specify an optional parameter on an interface you don,t have to make that parameter optional on any...
Should a method that implements an interface method be annotated with @Override? The javadoc of the Override annotation says: Indicates that a method declaration is intended to override a...
This may be a generic OOP question. I wanted to do a generic comparison between an interface and an abstract class on the basis of their usage. When would...
This question is the direct analogon to Class type check with TypeScript I need to find out at runtime if a variable of type any implements an interface. Here’s...
In one of my interviews, I have been asked to explain the difference between an Interface and an Abstract class. Here’s my response: Methods of a Java interface are...
What is the difference between using the Runnable and Callable interfaces when designing a concurrent thread in Java, why would you choose one over the other? 14 s 14...
EDIT: As of Java 8, static methods are now allowed in interfaces. Here’s the example: public interface IXMLizable<T> { static T newInstanceFromXML(Element e); Element toXMLElement(); } Of course this...