/**
* Testing Arrays
* @author N002213F
* @version 1.0
*/
public class JavaArrays {
public void processNames(String[] arg) {
//-- patented method, stop, do not read ;)
}
public void test() {
// works fine
String[] names1 = new String[] { "Jane", "John" };
processNames(names1);
// works fine, nothing here
String[] names2 = { "Jane", "John" };
processNames(names2);
// works again, please procced
processNames(new String[] { "Jane", "John" });
// fails, why, are there any reasons?
processNames({ "Jane", "John" });
// fails, but i thought Java 5 [vargs][1] handles this
processNames("Jane", "John");
}
}