If I have a class
public class Node {
private Object val;
public Object getObj() {
return this.val;
}
//Below will be the other accesor methods
.........
}
now if I have a list of Node , all with diferent objects in them, lets say a new Float() object, new Integer() Object, and a new
String() Object. How can I call toString on these Objects to return the original values instead of the hasg code values, cause that is what happens when i do a
x.getObj().toString()