Why Iterator don’t have a method to get next element directly without moving the cursor? It can be implemented on top of current Iterator interface but since it’s use will be rare, it doesn’t make sense to include it in the interface that everyone has to implement.

Tags:

1 comment to ''Know Iterator don’t have a method to get next element directly"

ADD COMMENT
  1. It can be implemented on top of current Iterator interface but since it’s use will be rare, it doesn’t make sense to include it in the interface that everyone has to implement. source : http://interviewguess.blogspot.in/

    ReplyDelete