How instanceof will work on an interface
问题 instanceof can be used to test if an object is a direct or descended instance of a given class. instanceof can also be used with interfaces even though interfaces can't be instantiated like classes. Can anyone explain how instanceof works? 回答1: First of all, we can store instances of classes that implements a particular interface in an interface reference variable like this. package com.test; public class Test implements Testeable { public static void main(String[] args) { Testeable testeable