For the conditions -d and -i i use a for(int i = 1; i < args.lenght-1; i++) and the task didn't pass. I changed in i < args.lenght; just like that... and pass, but i don't understand why? If args.lenght = 10 and args[0] = "-d", from 1 to 9 I have the rest of args array. If i loop until i = 10 I am not out of array!?