private void function() * callBack; should be private void function() callBack; void function() is a function pointer, void function()* is a pointer to a function pointer. On lines 23 and 41, you shouldn't be dereferencing callBack. Just use callBack() to call the function and 'this.callBack = callBack' to set it.