1) Java Enumeration is 1-way street. If you want to revisit, you should get sth else, or cache the references in sth like an ArrayList:
ArrayList list = new ArrayList();
while( enum.hasMoreElements()) list.add( enum.getNextElement());
Most of times you don't need this because normally there are other REVISITABLE data structures (such as Object[]) provided to do this trick.
2) A getter should be a read-only method. By making it writing, you are defeating the purpose of the method.
ArrayList list = new ArrayList();
while( enum.hasMoreElements()) list.add( enum.getNextElement());
Most of times you don't need this because normally there are other REVISITABLE data structures (such as Object[]) provided to do this trick.
2) A getter should be a read-only method. By making it writing, you are defeating the purpose of the method.