Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
260 views
by The go-to Tester (262 points)
retagged by
I am using csv reader to read a file and stoing array of strings in a value, how to convert those to list<long>.

Please provide some example.

1 Answer

0 like 0 dislike
by The go-to Tester (181 points)

If you are targeting Java 8 (or later), you can try this:

String[] numbers = new String[] {1, 2, 3, 4};
List<Long> longs = Arrays.stream(numbers)
                        .boxed().collect(Collectors.<Long>toList());
Hope above example helps.
asked Nov 16, 2016 by The go-to Tester (262 points)
retagged May 14, 2018 by
Is any other option to covert in java 7?


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...