Posts

Showing posts with the label StringJoiner

Java 8 - Strings, IO's and other bits and pieces

Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies. In this course we will discuss about Strings, IO enhancements, Comparators and many more. So let's get started Strings, IO's and other bits and pieces Java 8 is not only about lambda expressions and Streams. String class Java I/O package Collection interface Comparators - New way of writing them in Java8. Numbers Map Annotations Strings in Java 8 String s = "Hello world!" IntStream stream = s.chars(); // creates a stream on letters of s stream.mapToObj(letter -> (char)letter)            .map(Character::toUpperCase)                       .forEach(System.out::print); Output will be HELLO WORLD! StringJoiner String s1 = "Hello" String s2 = "World" String s = s1 + s2; The above way of string conca