Hi !
I wish to write the function where argument
can be
String or String [] ( like C printf ;-) )
void function(Object obj){
if( obj instanceof String ) // OK
.....
else if( obj instanceof (String []) ) // Syntax
.... // error
else throw new IllegalArgumentException();
---------------------------------------------
What's wrong here ?
I understand that exists some workaround like
if( obj.getClass() == .... )
But it don't seem elegant enough.
Thank you.
