Solved warning: [serial] serializable class example has no definition of serialVersionUID

Posted on 2007-10-01
Last Modified: 2013-11-23 warning: [serial] serializable class example has no definition of serialVersionUID
public class example extends JFrame implements ActionListener

I am getting this warning messsage. how do i get rid of it..thanks
Question by:zizi21
    LVL 3

    Accepted Solution

    You can add a constant implementing it to your code (I know your're probably never going to use it, but the warning message will disappear):

    public class Test extends JFrame implements ActionListener{

          private static final long serialVersionUID = -3088001842L;

    LVL 23

    Assisted Solution

    Theoretically, all the classes that directly/indirectly implement Seriliable
    interface should have serialVerionUID. IDEs like eclipse, show this as
    warning if its not there.
    More on javadocs here:

    Author Comment

    hi, btw, if i dont implement it, woudl anything happen to my program?
    LVL 3

    Expert Comment

    That depends, if you are going to serialize/deserialize your class then you may find problems. If you're not going to serialize/deserialize then ypu'r not going to have any problem, except for the Eclipse warning.

    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now