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

Popular posts from this blog

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

iphone - Smoothing a rounded stroke in Core Graphics -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -