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 forEach with index

Is there a way to build a forEach method in Java 8 that iterates with an index? Ideally I'd like something …

java for-loop foreach java-8
Filter values only if not null using lambda in Java8

I have a list of objects say car. I want to filter this list based on some parameter using Java 8. …

java lambda nullpointerexception null java-8
How to convert an iterator to a stream?

I am looking for a concise way to convert an Iterator to a Stream or more specifically to "view" the …

java iterator java-8
Class has been compiled by a more recent version of the Java Environment

While running selenium script, I am getting the following error message in Eclipse console: Class has been compiled by a …

java eclipse selenium firefox java-8
What does the arrow operator, '->', do in Java?

While hunting through some code I came across the arrow operator, what exactly does it do? I thought Java did …

java intellij-idea apache-commons java-8 apache-commons-collection
Does Java SE 8 have Pairs or Tuples?

I am playing around with lazy functional operations in Java SE 8, and I want to map an index i to …

java lambda functional-programming java-8 java-stream
Filter Java Stream to 1 and only 1 element

I am trying to use Java 8 Streams to find elements in a LinkedList. I want to guarantee, however, that there …

java lambda java-8 java-stream
Format Instant to String

I'm trying to format an Instant to a String using the new java 8 time-api and a pattern: Instant instant = ...; String …

java datetime java-8 datetime-format java-time
Android Studio Error: Error:CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running

Installed Android Studio 2.2 Preview 2 and getting this error: Error:CreateProcess error=216, This version of %1 is not compatible with the version …

java android android-studio java-8 android-studio-2.2
forEach loop Java 8 for Map entry set

I'm trying to convert old conventional for each loop till java7 to java8's for each loop for a map …

java lambda java-8