Create an event listener for when value has changed?

I have a sub-class that needs to run a function in the main-class when necessary, but from the sub-class, i cant just simply do that without creating some stack overflow or something. so i need to add an event listener inside the main class to check for that change of value in the sub-class.

I want to create an event listener to check for when an integer value has changed, so i don’t have to create a timer event in the main-class checking periodically, as that seems un-efficient and a large pain.

How would be best to create an event listener that checks for the change in an integer variable? I hate to be a bother but if there is any simple code example could be posted it would help me in the understanding process. I learn much better via direct example :stuck_out_tongue: THANKS.