Given this class describing linked nodes, where each node holds a
number:
public class LinkedNumber {
protected int number_ = 0;
protected LinkedNumber next_ = null;
/** create new node with indicated value and successor **/
public LinkedNumber(int initialValue, LinkedNumber n) {
number_ = initialValue;
next_ = n;
}
/** return currently held number */
public int value() { return number_; }
public void incrementAll() {
// write me
}
Write method incrementAll
, that increments the
value held by all nodes in the list.