you are getting the missing return statement. Why ? If for some reason the execution reaches the last if(-----) AND the condition inside that if evaluates to false then no value is returned. Suppose there was an else with the last if() and it returned a boolean, that error will go.
PS : Please give a short description of your code. It is easier to go through the code after reading some info rather than figuring out on my own.
If obj == this then a == this and a.number == this.number per definition. You can replace the entire block by this:
The rest of the functionality, testing for number equality, should be done if the instanceof operator returns true - the part you're missing right now.