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.

Java 8: merge lists with stream API

I have the following situation Map<Key, ListContainer> map; public class ListContainer{ List<AClass> lst; } I …

java list java-8 java-stream
What's the difference between Instant and LocalDateTime?

I know that: Instant is rather a "technical" timestamp representation (nanoseconds) for computing. LocalDateTime is rather date/clock representation including …

java datetime java-8
Default interface methods are only supported starting with Android N

I upgraded to android studio 3.1 and I'm getting the following error: Default interface methods are only supported starting with Android …

android java-8 kotlin
What are functional interfaces used for in Java 8?

I came across a new term in Java 8: "functional interface". I could only find one use of it while working …

java lambda interface java-8
Tomcat 8 Maven Plugin for Java 8

Is the tomcat7-maven-plugin working with a tomcat 8 server and java 8? I can't find any tomcat8-maven-plugin.

tomcat java-8 maven-tomcat-plugin tomcat8
Can you split a stream into two streams?

I have a data set represented by a Java 8 stream: Stream<T> stream = ...; I can see how to …

java java-8 java-stream
How to convert java.sql.timestamp to LocalDate (java8) java.time?

In Java 8, how can I convert a Timestamp (in java.sql) to a LocalDate (in java.time)?

java timestamp java-8 localtime java-time
Why is ZoneOffset.UTC != ZoneId.of("UTC")?

Why does ZonedDateTime now = ZonedDateTime.now(); System.out.println(now.withZoneSameInstant(ZoneOffset.UTC) .equals(now.withZoneSameInstant(ZoneId.of("UTC")))); print …

java datetime java-8 java-time
Java 8 Filter Array Using Lambda

I have a double[] and I want to filter out (create a new array without) negative values in one line …

java lambda java-8
Can an interface method have a body?

I know that an interface is like a 100% pure abstract class. So, it can't have method implementation in it. But, …

java interface java-8 default-implementation