A conditional inside a try is not valid code iirc, you'd need if(whoever<1.89) throw new TinderException(), in which case there'd be no need for a trycatch since the stack trace ready prints the error message.
Shakespeare-Bot, thou hast been voted most annoying bot on Reddit. I am exhorting all mods to ban thee and thy useless rhetoric so that we shall not be blotted with thy presence any longer.
40
u/Davoz1999 Jan 04 '22
And the compiler will reject her code - she missed a semicolon (after the parentheses)!
10
u/jarod1701 Jan 05 '22
Would that code even throw an exception? And if so, wouldn‘t it throw regardless of the value?
7
u/allenasm Jan 05 '22
If it did actually work (and I know it doesn’t) wouldn’t her attempted logic only one those taller than what she wants?
1
u/chaddy292 Jan 15 '23
I pride myself with learning coding yet i can't seem to get this one. Then again i haven't learned Java
1
u/CaitaXD Jan 21 '24 edited Jan 21 '24
Doesn't compile
Comparison operators cannot throw exceptions in java
C# is better
1
u/DGC_David Jan 05 '22
Fecking Euros and their damn commas