0
Throw in java help
does throw in java only works with "if else"?all the example i found is with "if else".could it be done without them?
4 Answers
0
yes it can be done,but most of the time u want to throw an exception if some condition fails
0
how to use throw for arrayindexoutofboundsexception?
0
Why I you want throw that? That's what Arrays do automatically.
But you can write anywhere in your code :
throw new ArrayIndexOutOfBoundsException() ;
0
@1of3
i just learned about throw ytd.im just playing around with the code haha.i have figured out now
https://code.sololearn.com/cwXucXgb8QGQ/?ref=app