In Java - as in most languages, an array or other collection is accessed via indexes which run from 0 to the number of items in the collection minus one.
So an array with 3 elements, can have valid indexes of 0, 1, and 2 only - all other values are outside the bounds of the collection because they refer to elements that don't exist.
So when your loop looks like this and
input_final
had three elements:
for(int i=0;i<=input_final.length();i++) {
The values of
i
would be 0, 1, 2, and 3, which throws an exception because the final index is not in the collection.
Change the test to exclude the equality check and it only uses 0, 1, and 2 so no problem occurs:
for(int i=0;i<input_final.length();i++) {