I need to store objects in Java as strings and then transform them back to their object form. For example, a stringified Dog class looks like this: Dog@d716361
.
Any idea how can I do that or another way to store objects as strings would be appreciated.
The class:
public class Dog {
private String name;
Dog(String n) {
name = n;
}
public String getName() {
return name;
}
}