Member Avatar for mehnihma

I need to take arguments and change the extensio of the file for writting but I get java.lang.ArrayIndexOutOfBoundsException: 1
Why?

Is there any better way?

// change file name for saving the output file

        int dot = inputFile.lastIndexOf('.'); // check for the dot
        String baseName = (dot == -1) ? inputFile : inputFile.substring(0, dot); // split the input file name
        String outputFile = baseName+".bin"; // save the file weith bin extension
Member Avatar for mehnihma

I got it :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.