Does “instanceof Void” always return false?
问题 Can this method return true somehow? public static <T> boolean isVoid(T t) { return t instanceof Void; } 回答1: Yes, but I'm sure that isn't really useful: public static void main(final String[] args) throws Exception { final Constructor c = Void.class.getDeclaredConstructors()[0]; c.setAccessible(true); System.out.println(c.newInstance(null) instanceof Void); } A Void class can't be instantiated so normally your code wouldn't require to deal with Void instances. The above code snippet is just