"newPoint" default value is null , you did not instance it no where .When you create an object it's call the contrustor automaticaly. You did not assign any value to newPoint in the constructor....