1

folks... I have enum Rotation with only one method - public Rotation next(). When calling rot.next() will return the next enumeration element representing the next 90 degree clock-wise rotation after rot. If, for example, intially the position at CW0 the next call of the method would return CW90 and the next call would return CW270. I've already looked what was considered to be a duplicate but my case is different. I'm really stuck in this method and cannot come up with any ideas. Please somebody help me with this. Could anyone put me on a track how to implement this method? I appreciate if anybody helps.

public enum Rotation{
  CW0, CW90, CW180, CW270;

  // Calling rot.next() will return the next enumeration element
  // representing the next 90 degree clock-wise rotation after rot.
  public Rotation next();
}
Mike
  • 23
  • 4

0 Answers0