How to add elements from string added from console to a list in java -
how can add elements list input in java.
like if put:
scanner reader = new scanner("a,b,c,d,e);
i want have string[] = {a,b,c,d,e];
using scanner methods whiles , little bit lost
sorry english( not main language)
| you want use string.split(). see here example: tutorialspoint.com/java/java_string_split.htm after read string scanner, split on comma. – dcp apr 22 '14 @ 0:48 |