1 public class SquareSequence implements Sequence
2 {
3 private int n;
4
5 public int next()
6 {
7 n++;
8 return n * n;
9 }
10 }