share

Monday, 14 December 2015

How to Convert Enumeration to Arraylist - Java Example

We can convert enumeration to arraylist in java with  the help list() method of Collections.

package javaproficeincy;

import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Vector;

public class EnumerationToList {
public static void main(String[] args) {
Vector<String> vt = new Vector<String>();
        vt.add("java");
        vt.add("php");
        vt.add("array");
        vt.add("string");
        vt.add("c");
        Enumeration<String> enm = vt.elements();
        List<String> ll = Collections.list(enm);
        System.out.println("List elements: "+ll);
}

}


Output:

List elements: [java, php, array, string, c]

Related Posts :


18 comments:

  1. wow this is the thing i was looking for

    ReplyDelete
  2. thanks for sharing wonderful blog with us. its really more helpful to our institute candidates to get aware some useful knowledge keep sharing more information.
    Dot Net training in Chennai

    ReplyDelete



  3. Great and useful article. Creating content regularly is very tough. Your points are motivated me to move on.


    SEO Company in Chennai

    ReplyDelete
  4. I have read your blog its very attractive and impressive. I like it your blog.




    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai Java 8 Training in Chennai JavaEE Training in Chennai JavaEE Training in Chennai

    ReplyDelete
  5. Thanks for sharing this program.It is really helpful.Continue sharing more like this.
    Regards,
    Java Training in Chennai | Java Training Institutes in Chennai | Java courses in Chennai

    ReplyDelete
  6. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
    Best hadoop training institute in chennai|Hadoop Training Chennai|Hadoop Training in Chennai

    ReplyDelete
  7. Excellent post!!! Your article helped to under the future of java development. Being an open source platform, java is integrated in most of the software development industries to create rich featured applications.Java Course in Chennai | Best JAVA Training in Chennai

    ReplyDelete
  8. Nice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep your blog as updated.
    Regards,
    cloud computing training in chennai|cloud computing training

    ReplyDelete
  9. Excellent post!!! The future of cloud computing is on positive side. With most of the companies integrate Salesforce CRM to power their business; there is massive demand for Salesforce developers and administrators across the world.Salesforce Training in Chennai | Salesforce Training Institutes in Chennai

    ReplyDelete
  10. Hi, Really your post was very informative. Today's internet era learn Hadoop Online Training will helps you to reach your goal.Selenium Training

    ReplyDelete
  11. Nice sharing. R is a language and environment for statistical computing and graphics. Want to make a career in R Programming. Learn R Programming Training course @ GangBoard. We are the best provider of online training on evergreen technologies.

    ReplyDelete
  12. It's very best beneficial blogs.I read this subjects blog such a great blog and good sharing I'll be like this information post.
    Selenium Training in Chennai
    Selenium Training

    ReplyDelete
  13. This post was quite awesome and interesting to read. Congrats for your work. Thanks a lot for providing this with us. Keep on updating this with us regularly.
    Best institute chennai

    ReplyDelete
  14. Excellent blog.This was really helpful.I would like to read more about java.
    Regards,
    Salesforce Training in Chennai | Salesforce course in Chennai

    ReplyDelete