#WHY DOES IT GO TO THE ELSE STATEMENT EVEN IF CONDITIONS ARE WRONG?
7 messages · Page 1 of 1 (latest)
Hey, @harsh marlin!
Please remember to /close this post once your question has been answered!
The else only applies to the if it's immediately attached to
Just if / else constructs may not be helpful to you here. You may want an isValid() method that returns false if you found any of those faults
(Also what's wrong with your caps lock key? Unreadable titles like yours bias readers into ignoring it)
wont the constructor throw an error regardless unless each specified field has been fulfilled anyway?
So...
- there is no constructors here
- no errors are being "thrown", they're being displayed with a pop-up window
- the point was how the "success" window displays even when there are errors