exception handling java user input
问题 I'am trying to put an exception in my code. But it doesnt work fully. Im trying for user to enter integers and then adding it to a list. how come it only works for the first input? say if the first I enter 1.0 then it will raise the error. but if I put say 10, 1.0 it doesnt produce an error. and when i print the list. there is only the 10 well this is actually correct. but i want to make it so that if anything is entered other than integer it raise an error, and does not terminate. instead