|
Yes, java does automatic type casting in some cases.
Your index out of bounds problem is happening because when its a space you do nothing to it im guessing. Counter doesint increase.. hard to say cuz i dont see your code. BUt whatever the case, if there is a space it doesnt accounts for it and then goes past your sentence array length.
|