Can this method return true somehow?
public static <T> boolean isVoid(T t)
{
return t instanceof Void;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, but I’m sure that isn’t really useful:
A
Voidclass can’t be instantiated so normally your code wouldn’t require to deal withVoidinstances. The above code snippet is just an example of what havoc you can unleash when using reflection… 😉