Re: How to handle exceptions in constructor?
- From: "George George via JavaKB.com" <forum@xxxxxxxxxx>
- Date: Wed, 29 Jun 2005 03:16:19 GMT
Thanks Stefan,
Stefan Schulz wrote:
>> I think we should throw the exception to let the invoker know that the
>> instance of the object has not been created successfully, so that the invoker
>> can peform appropriate actions. But I am not quite sure whether I am correct
>> since I have not seen any constructors which throw exceptions before.
>>
>> Could anyone help?
>
>You absolutely should pass the exception through, or at least throw
>another, if your object could not be successfully constructed. A
>constructor can throw Exceptions just like any other method
>
Your reply is very helpful.
regards,
George
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200506/1
.
- References:
- How to handle exceptions in constructor?
- From: George George via JavaKB.com
- Re: How to handle exceptions in constructor?
- From: Stefan Schulz
- How to handle exceptions in constructor?
- Prev by Date: Re: How to handle exceptions in constructor?
- Next by Date: Re: How to handle exceptions in constructor?
- Previous by thread: Re: How to handle exceptions in constructor?
- Next by thread: Re: How to handle exceptions in constructor?
- Index(es):
Relevant Pages
|