在使用数组的时候要留意,一定要先完整的创建好数组,再对其操作
1 2 3 4
| String[] commands=null; commands = new String[arrayListCommand.size()]; commands = (String[]) arrayListCommand.toArray(commands);
|
1 2 3 4 5 6
| String[] commands=null; commands = (String[]) arrayListCommand.toArray();
|