If I extend an exception (which can be serialized) do I need to
explicitly implement serializable?
public class MyException extends Exception {
static final long serialVersionUID = 1L;
public MyException(Exception exception){
super(exception);
}
}
thank
Tim
zero - 12 Dec 2005 03:30 GMT
timasmith@hotmail.com wrote in news:1134358077.170997.109570
@f14g2000cwb.googlegroups.com:
> If I extend an exception (which can be serialized) do I need to
> explicitly implement serializable?
[quoted text clipped - 12 lines]
>
> Tim
No.
The main reason for mentioning it, even though it's not really necessary,
would be to make it more obvious that you're implementing it. So it's
mostly for readability.

Signature
Beware the False Authority Syndrome
Roedy Green - 12 Dec 2005 04:00 GMT
>If I extend an exception (which can be serialized) do I need to
>explicitly implement serializable?
[quoted text clipped - 6 lines]
> super(exception);
> }
Any subclass automatically implements all the interfaces of the base
class. You can optionally provide another serialVersionUID which can
be considered the version number of the extension fields
.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.