/Vector Secret
Last active
September 5, 2020 13:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.* | |
public class VectorExample{ | |
public static void main(String args[]){ | |
Vector<String> vector = new Vector<String>(); //creating arrayList object | |
vector.add("Ravi"); | |
vector.add("Ram"); | |
vector.add("Ravi"); | |
vector.add("Rajeev"); | |
//For traversing the list | |
Iterator<String> itr = vector.iterator(); | |
while(itr.hasNesxt()){ | |
System.out.println(itr.next()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment