EVerytime I write any code similar to this one, I get this type of error. It\'s building a file but not letting it run, it just throws exception. I\'m not familiar with exce
for (int i=0; i<=name.length();i++){
String indexes are starting from 0 .
Example :
String str = "abc";
int len = str.length(); //will return 3
str.charAt(3); will throws StringIndexOutOfBoundsException charAt starting position is 0 . So the limit is length-1 .
You have to change your for loop to for (int i=0; i