Since the string that you passed into the constructor is called 'name', when you say name = "HP" you're changing the String that was passed in. The name attribute of the class is never initialized which is way you are getting null.
Good point! This is exactly the problem. I don't know how i missed that.
