I have one class Data.java
public class Data{
private String name;
private String age;
// getters and setters for the above fields
}
In one of my method i performed
String newData = getData().toString();
But now i want the Data object back in its state instead of string object. so how to perform this in java.