Implemented default and explicit value constructor, and hasNext method