• Register
0 votes

Problem :

I am having following warning message.

The serializable class does not declare a static final serialversionuid field of type long

I would like to understand and resolve the issue. Can somebody explain me this issue with simple words? I know what OOPs is

Please find below my code for your reference :

import java.awt.*;
import javax.swing.*;
public class HelloSwing extends JFrame {
JTextArea m_resultArea = new JTextArea(6, 30);
public HelloSwing() {
//... Set initial text, scrolling, and border.
m_resultArea.setText("Enter some more text to see scrollbars");
JScrollPane scrollingArea = new JScrollPane(m_resultArea);
// Get the content pane, set layout, add to center
Container content = this.getContentPane();
content.setLayout(new BorderLayout());
content.add(scrollingArea, BorderLayout.CENTER);
public static void createAndViewJFrame() {
JFrame win = new HelloSwing();
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
public void run(){
7.5k points

1 Answer

0 votes

Solution :

Please find below the solution on your problem :

You can configure your IDE in two ways:

·To ignore the error message instead of giving a warning.

·To auto generate an id

It can cause the problem only if you are serializing objects and deserializing them in a different place OR time where the class has changed, and it will not result in freezing, but in InvalidClassException

36.1k points

Related questions

0 votes
1 answer 200 views
Problem : I am trying to learn Java, I am very newbie however I wanted to know what I do to get the "run" it. I am facing below error: Static Error: This class does not have a static void main method accepting String[]. Below is my code: public class MyCaneirinho { public static void mycontar ... { System.out.println(j + x + y); } else { System.out.println(j + x + y + z); } } } } // MyCarneirinho
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 33 views
Problem : In Java, I want to have something as below : class MyClazz<T> {  static void doIt(T object) {    // More code  } } But I face below error &ldquo;Cannot make a static reference to the non-static type T&rdquo; I am unable to understand ... about a subject. Could someone clarify if such the use is possible, by the similar manner? Also, why was my original attempt went unsuccessful?
asked Jan 21 jwilliam 3.9k points
0 votes
1 answer 40 views
Problems:- Can any one help with one of the query I am facing in declaring variable type Declare a reference variable of type File named myFile. Any Idea
asked Feb 13 maddi86 5.4k points
2 votes
1 answer 14 views
Problem: Let me thanks to all Kodlogs users first. I found this website very helpful over the internet. I found all the users and their behavior and solutions very helpful. Anyway, I am trying to learn java and I write my very first java program. Unfortunately, my ... using eclipse java as my IDE. Don&rsquo;t know is it the problem of my coding or the IDE. Any legitimate solution is appreciated.
asked Mar 29 Gavin 15.2k points
0 votes
1 answer 20 views
Problems: I am new in programming and my logic is not good, can anyone give the right solution? How can we declare an array named scores of twenty-five elements of type int?
asked Feb 13 maddi86 5.4k points