Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Implement serializable if I already extend it?

Thread view: 
timasmith@hotmail.com - 12 Dec 2005 03:27 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.