View Single Post
  #8 (permalink)  
Old 10-31-2007, 12:30 AM
JavaBean's Avatar
JavaBean JavaBean is offline
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Quote:
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.
Reply With Quote