java - Is it okay for constructors to throw runtime exceptions? -
When a constructor is disconnected from the methods examined, which can not handle the constructor, OK to throw out as a runtime exception, if you have a confirmation that this app can not handle it and will be useless without creating the object?
Yes, in many constructors they are indispensable when they call other methods because always a possibility That they will throw an unsolicited exception in advance.
Comments
Post a Comment