First of all, you need to fill your Digit
with DigitNode
's objects. I don't see the code which does that from snapshot you posted.
Presumably you could do this in constructor of Digit
, or create a method Digit
.add(DigitNode
node). You need this, otherwise your current
will always be null.
Next, you need to add toString in DigitNode
as I said earlier in the comment, or you could change Digit
.toString() to have :
strVal = strVal + position.num + " "; // note position.num to get the number