I have created a demo class as follows:
public class Demo2 implements Serializable { int id; public static void main(String[] args) { System.out.println("Hi"); }}When I execute the command:
serialver com.sample.Demo2it provides the correct result:
com.sample.Demo2: private static final long serialVersionUID = -3814645723313276333L;For the second class:
public class Demo { static class Serial implements Serializable { int id; } public static void main(String[] args) { System.out.println("Hi"); }}When I execute the command:
serialver com.sample.Demo$SerialI get following output:
Class com.sample.Demo is not Serializable.I have OpenJDK 21.0.7 installed on my Ubuntu machine:
Is there any way, this can be resolved?
