You down with OOP? Yeah you know me!
Thank goodness for thatsudipto shekhar wrote:...not to be implemented in some code.....
Jesper de Jong wrote:Rajat, welcome to the Ranch!
Thanks for the code. It looks a little bit strange to me, though. Why does class Datatype extend Exception, and why do you use exceptions like that in your code?
Exceptions should be used only for "exceptional" situations - when something unexpected happens while the application runs. Don't use exceptions for normal control flow, as you are doing in that code. Also, never swallow exceptions (lines 22 and 35) without showing anything to the user - because when something goes wrong, the user will never know that something went wrong.
It's exactly the same and completely different as this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|