Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How can I get the serialVersionUID of a class?
The following code can help u to obtain serialVersionUID of a class

import java.io.*;

public class jk 
{
	public static void main(String args[]) 
	{
		String s = new String("test");
		Class cl = s.getClass();
		long uid = ObjectStreamClass.lookup(cl).getSerialVersionUID();
		System.out.println(uid);
	}
}