I am working with a textbook right now and one of the answers to the 'test' questions seems wrong to me. They have the following code example:
while(true){
doStuff();
}
static void doStuff(){
for (int i = 10; i > 5; i++){
if(i > 100000){
break;
}
}
}
And according to them, the answer is
"F: The program will hang without ever completing"
As opposed to
"C: A StackOverflowError might be thrown"
I suppose I don't understand why a StackOverflow error would NOT eventually be thrown in this infinite loop? Is it because I have not marked it as an exception via try/ catch / throws? Would it be different if we were creating variables within that for loop which take up memory? Or am I misunderstanding entirely?