CSC300: Common mistakes: Does this work? [9/17] Previous pageContentsNext page

11
12
13
14
15
16
17
  public int numFives () {
    int result = 0;
    for (Node x = first; x != null; x = x.next) 
      if (x.item == 5.0)
        result = result + 1;
    return result;
  }

Previous pageContentsNext page