Given a class named ThisClass that contains only this:
public static void main(String[][] args) {
System.out.println(args[0][1]);
}
public static void main(String[] args) {
ThisClass app = new ThisClass();
String[][] newargs = {args};
app.main(newargs);
}
If you compile it and then run it with java ThisClass a b c
it prints:
b
...so it's taking the first array and automatically wrapping it to fit the 2d array?? That is weird. Can someone break down what is going on here? I'm pretty sure I'm missing something.