0

Java program to accept a list of 5 elements from command line and store them in vector

4th Apr 2017, 3:01 PM
Priyanshi
Priyanshi - avatar
3 Antworten
+ 3
Scanner scan = new Scanner(System.in); for (int i=0; i<5; i++) { String s = scan.next(); vector.add(s); } but also why r u using a vector and not something like an arraylist
4th Apr 2017, 4:15 PM
Edward
+ 1
no problem
4th Apr 2017, 4:37 PM
Edward
0
Tysm Edward for ur help.
4th Apr 2017, 4:23 PM
Priyanshi
Priyanshi - avatar