How to Remove all elements from vector?

citas para infonavit por internet In this example, we will see how to remove all the elements from a Vector. We will be using  get link clear() method of Vector class

source url package test; import java.util.Vector; public class RemoveAll { public static void main(String a[]){ Vector<String> vct = new Vector<String>(); //adding elements to the end vct.add("Selenium"); vct.add("Java"); vct.add("UFT"); vct.add("Other"); System.out.println("Actual vector:"+vct); vct.clear(); System.out.println("After clear vector:"+vct); } }

source url http://parklane.on.ca/while-some-see-a-pile-of-dirt-we-see-a-blank-canvas-2/ Output:

http://avpsolutions.com/blog/page/34/ Actual vector:[Selenium, Java, UFT, Other]
After clear vector:[]

The only business I know is learning new technology and spreading the knowledge. I believe sharing is learning. This is my prime reason to build this site.
I welcome and value your comments, suggestions and corrections.

here 274total visits,1visits today

here The only business I know is learning new technology and spreading the knowledge. I believe sharing is learning. This is my prime reason to build this site. I welcome and value your comments, suggestions and corrections.