{"id":1627,"date":"2016-09-14T17:07:56","date_gmt":"2016-09-14T17:07:56","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=1627"},"modified":"2016-09-14T17:07:56","modified_gmt":"2016-09-14T17:07:56","slug":"iterator-vs-enumeration","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/iterator-vs-enumeration\/","title":{"rendered":"Iterator vs Enumeration"},"content":{"rendered":"<p><strong>Iterator<\/strong><br \/>\nIterator is the interface and found in the java.util package.It has three methods<\/p>\n<ol>\n<li>hasNext()<\/li>\n<li>next()<\/li>\n<li>remove()<\/li>\n<\/ol>\n<p><strong>Enumeration<\/strong><br \/>\nEnumeration is also an interface and found in the java.util package .An enumeration is an object that generates elements one at a time. It is used for passing through a collection, usually of unknown size.The traversing of elements can only be done once per creation.<\/p>\n<p>It has following methods<\/p>\n<ol>\n<li>hasMoreElements()<\/li>\n<li>nextElement()<\/li>\n<\/ol>\n<p>An iterator over a collection. Iterator takes the place of Enumeration in the Java collections framework.Iterators differ from enumerations by allowing the caller to remove elements from the underlying collection during the iteration. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Iterator Iterator is the interface and found in the java.util package.It has three methods hasNext() next() remove() Enumeration Enumeration is also an interface and found in the java.util package .An enumeration is an object that generates elements one at a time. It is used for passing through a collection, usually of unknown size.The traversing of&hellip; <a href=\"https:\/\/codethataint.com\/blog\/iterator-vs-enumeration\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142],"tags":[],"class_list":["post-1627","post","type-post","status-publish","format-standard","hentry","category-java-concepts"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=1627"}],"version-history":[{"count":1,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1627\/revisions"}],"predecessor-version":[{"id":1628,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/1627\/revisions\/1628"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=1627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=1627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=1627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}