Witam,
Chciałbym sobie w metodzie poniżej zwrócić w tablicy substringi, a w kolejnej je wywołać natomiast otrzymuję wyjątek StringIndexOutOfBoundsException po odpaleniu poniższego kodu.
public String[] tabSubstr(){
...
String s1 = sb.substring(0, 32);
String s1 = sb.substring(32, 48);
String s2 = sb.substring(48, 64);
return new String[] {s1, s2, s3};
}
public void wypisz(){
String[] tabstr = new String[3];
tabstr = tabSubstr();
for(int i = 0; i < 3; i++){
System.out.println(tabstr[i]);
}
}