Earlier we shared Vector to ArrayList and Vector to Array conversion. In this tutorial we are gonna see how to convert a Vector to List. The steps are as follows: 1) Create a Vector and populate it 2) Convert it to a List by calling Collections.list(vector.elements()) which returns a List object. To explain the logic we are assuming that Vector is having elements of String type(). However if you want to have a different type then just change the generics in the below code. Founder of beginnersBook.com, loves Java and open source stuff. BeginnersBook.com is a tech blog where he shares tutorials on programming (Java, C, CPP), WordPress, SEO and web development. To explain the logic we are assuming that Vector is having elements of String type(). However if you want to have a different type then just change the generics in the below code. Founder of beginnersBook.com, loves Java and open source stuff. BeginnersBook.com is a tech blog where he shares tutorials on programming (Java, C, CPP), WordPress, SEO and web development. Source.

Menu
whatsapp button