Why i am getting error that my class is not Seriazable?
import java.util.*;
class Comp implements Comparator,Serializable {
private int count = 0;
static public int MAXSETS = 1;
private int a[] = new int[MAXSETS];
private int b[] = new int[MAXSETS];
public int compare(Object a,Object b)
{
Integer a1=(Integer) a;
i really don't do serializing, but if you posted your code as is, then you should try importing the java.io.Serializable class. java.io classes need explicit importing. or you can use the long version everytime by doing a java.awt.Frame, or java.io.serializable everytime you use a class that is not in java.lang.
12-26-2002, 04:23 AM
xylex_blaiste
also NotSerializableException is thrown by a readObject or writeObject method. check your methods which have these since this is most probably what's causing it.