I have a class
Employee{
int sal;
String name;
String role;
}
I have to serialize the object, but doesn't want to serialize the variable "role". I don't want to declare the variable as transient.
Does anyone how to do it?
Printable View
I have a class
Employee{
int sal;
String name;
String role;
}
I have to serialize the object, but doesn't want to serialize the variable "role". I don't want to declare the variable as transient.
Does anyone how to do it?
Roll out your own Serializer and define SerialPersistentFields ...... Good luck and you can read more at
Java Beginner Tutorial
Thanks Elisha for directing me to rite path