If your object has two properties, a String property and a primitive
int property than you need a way to retrieve those properties. You
need getters. Normally, when you write the class file for the object
class you would write the getter method there. Write now you are
trying to cast the entire object as an Integer which will produce
undesired results,