Top "Java-8" questions

Use this tag for questions specific to Java 8 which is version 8 (internal number 1.8) of the Java platform, released on 18 March 2014.

How can I count occurrences with groupBy?

I want to collect the items in a stream into a map which groups equal objects together, and maps to …

java functional-programming java-8
In Java 8 how do I transform a Map<K,V> to another Map<K,V> using a lambda?

I've just started looking at Java 8 and to try out lambdas I thought I'd try to rewrite a very simple …

java map lambda java-8 java-stream
Modifying Objects within stream in Java8 while iterating

In Java8 streams, am I allowed to modify/update objects within? For eg. List<User> users: users.stream().…

java java-8 java-stream
Convert Iterable to Stream using Java 8 JDK

I have an interface which returns java.lang.Iterable<T>. I would like to manipulate that result using …

java java-8 java-stream iterable
When to use: Java 8+ interface default method, vs. abstract method

Java 8 allows for default implementation of methods in interfaces called Default Methods. I am confused between when would I use …

java interface java-8 abstract-class default-method
Java 8 Stream API to find Unique Object matching a property value

Find the object matching with a Property value from a Collection using Java 8 Stream. List<Person> objects = new …

java filter java-8 java-stream
How should we manage jdk8 stream for null values

Hello fellow Java developers, I know the subject may be a bit in advance as the JDK8 is not yet …

java null java-8 java-stream
Is JVM ARGS '-Xms1024m -Xmx2048m' still useful in Java 8?

I have a Java 7 application using JVM ARGS: -Xms1024m -Xmx2048m, and it runs pretty well. After I upgrade …

java jvm java-8 jvm-arguments
How to specify function types for void (not Void) methods in Java8?

I'm playing around with Java 8 to find out how functions as first class citizens. I have the following snippet: package …

java java-8
Can a java lambda have more than 1 parameter?

In Java, is it possible to have a lambda accept multiple different types? I.e: Single variable works: Function <…

java lambda java-8