Our website loads in split second powered by Schema Theme. Thanks to MyThemeShop

Tag: Java8

Java8 – Convert List to comma separated String in java

Converting List<String> to comma separated string in java8 is very simple and straight forward, with String join We simply can write String.join(..), pass a delimiter and an Iterable and the new StringJoiner will do the rest. If we are  working with a stream we can write it using Collectors. Here …


java8 – forEach vs forEachOrdered

With Java8 streams, we take the advantage of parallelism on multi core processor. Java8 has introduced forEach() forEachOrdered() on collections to iterate over a stream of elements, however there is a difference between the two methods. Quoting from Javadoc: …