You are missing the map operator here. You have to add map operator to the stream processing pipeline before collecting it. Here’s how it looks.
objList.stream().map(Obj::val).collect(Collectors.joining("."));
More Related Contents:
- java how to convert string to String[] and put in Specific string variabel
- Java: convert List to a join()d String
- Java 8 stream reverse order
- Sorting a list with stream.sorted() in Java
- Best way to concatenate List of String objects? [duplicate]
- Nested lists with streams in Java8
- Why didn’t Stream have a toList() method?
- Get last element of Stream/List in a one-liner
- incompatible types required char found java.lang.string
- All possible Angram String combinations in java [closed]
- Problems converting byte array to string and back to byte array
- Parse String to Date with Different Format in Java
- How to print out all the elements of a List in Java?
- How can I use “.” as the delimiter with String.split() in java [duplicate]
- What is the difference between List and ArrayList? [duplicate]
- Reverse a given sentence in Java
- Extract string between two strings in java
- How to convert a String into an ArrayList?
- Java Stream: divide into two lists by boolean predicate
- Convert String to Uri
- Calculating frequency of each word in a sentence in java
- What is the difference between List.of and Arrays.asList?
- Arrays.asList(int[]) not working [duplicate]
- Remove all non-“word characters” from a String in Java, leaving accented characters?
- Fastest way to strip all non-printable characters from a Java String
- Simple way to sort strings in the (case sensitive) alphabetical order
- How to short-circuit a reduce() operation on a Stream?
- Want to create a stream of characters from char array in java
- what is Ljava.lang.String;@
- java streams in Java 7