How to make this string return a null if we put things = null
public class Test {
static String concatAll(Object[] things) {
StringBuffer result = new StringBuffer();
for (int i = 0; i < things.length; i++) {
result.append( things[i] );
}
String x = result.toString();
return x;
}
public static void main(String [] args)
{
Object[] obj = {19, "abc", " ", 3.5};
System.out.println(concatAll(obj));
}
}
this code will print
19abc 3.5
when i put obj = null
in the main method this code is not working, Why?