I have a class marked Serializable i.e. this class implements Serializable interface. This class has some variables of type Serializable. I am unable to understand that why these variables are of Serializable type.I know about the Serializable Interface. Please make this concept clear. It will be a great help. My class is-
public class DestinationGroups implements java.io.Serializable {
private int id;
private Serializable name;// why serializable here??
private Serializable description;// why serializable here??
private BigDecimal rating;
private Set destinationses = new HashSet(0);
private Set destinationGroupRatingses = new HashSet(0);
public DestinationGroups() {
}
public DestinationGroups(int id) {
this.id = id;
}
..........other code..............
}