Hi I'm having issues with the code below (file is of the File class):
String[] fileNameSplit = file.getName().split(".");
String fileType = fileNameSplit[(fileNameSplit.length - 1)];
It always throws a ArrayOutOfBoundsExecption at -1 suggesting that fileNameSplit is 0. When I take out the -1 it still says ArrayOutOfBoundsException but now at 0, meaning it is empty.
What am I doing wrong?