In the function below, what can I use to replace <typedefinition>
to make the program print "O noes!"?
public static void main(String[] args) {
Object o = null;
story(o);
}
private static void story(<typedefinition> o)
{
if (o != null)
System.out.println("O noes!");
else
System.out.println("O yes");
}
private static void story(Object... o)
Because if you pass null, is considered as an array (Object[]) of 1 elem (and so != null)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With