The data you are going to set or get using getter or setter method some times may need to pass through network from one remote to another remote system.Serializable is property that allows you to write the data or the object state into an output stream and fetch it back from there...
why do we implement serializable in getter and setter ???
Can you please explain your question more clearly?
Getters and setters are methods. You cannot implement interface Serializable in a method. Is your question about what Serializable means?
Or did you mean to ask why in a Java Bean (which is a class that has getter and setter methods) you should implement Serializable? If you meant that, that's because it's one of the criteria which makes a class a Java Bean. Wikipedia says:
"In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behavior. These conventions make it possible to have tools that can use, reuse, replace, and connect JavaBeans.
The required conventions are:
* The class should be serializable (able to persistently save and restore its state) * It should have a no-argument constructor * Its properties should be accessed using get, set and other methods following a standard naming convention * It should contain any required event-handling methods"