Questions tagged as 'java-8'

4
answers

What are the advantages of Lambda Expressions present in Java 8?

Java 8 will be released soon ( March 2014 ) and the feature of this version are Lambda expressions . Could anyone describe, as the question says, what this feature will actually add to the developers and, if possible, any example code co...
asked by 13.12.2013 / 12:29
1
answer

How does Spliterator work in Java 8?

In Java 8 (which was released in March 2014), there is a new interface called Spliterator . It has a similar purpose to the Iterator , but it is designed to perform iterations in parallel . However, even after reading a lot about this inter...
asked by 16.12.2013 / 05:30
3
answers

How to use more than one separator character in the split () method?

I'd like to break String into several substrings, for this I'm using the split() method. It turns out, I'm not sure what characters can be in the variable I'll use. Exemplifying: String words[] = line.split(" "); This code...
asked by 26.11.2014 / 18:09
2
answers

Why use a generic return?

I was looking at the signature class methods Optional and I did not understand what this <T> means in front of the method return empty() : public static <T> Optional<T> empty() It returns a O...
asked by 26.11.2015 / 22:28
1
answer

Java Interface 8

Java 8 allows you to implement methods in the interface itself. So I would like to know what an abstract class can do that an interface can not. Source: link     
asked by 01.10.2015 / 22:25
2
answers

Java 8 "default method" versus C # "extend method"

Java 8 introduces the concept of "standard method" to allow adding new functionality to an interface. C # provides "extension methods" that allow you to "add" methods (features) to existing types. Considering how they are implemented by th...
asked by 02.04.2016 / 01:05
3
answers

How to check if a LocalDate is a weekend?

I have the following date of type LocalDate 2017-12-21 How do I check if it's a weekend? I tried to use Calendar , but it seems to only work with Date .     
asked by 22.12.2017 / 02:52
2
answers

What are functional interfaces?

What are functional interfaces in Java? Has this concept already existed or came out of version 8 of Java?     
asked by 31.03.2014 / 21:02
1
answer

Can the & bitwise (and) operator of Java be used for interfaces?

Interface source code snippet Comparator . Does anyone explain to me how this Comparator<T> & Serializable is handled? public static <T, U extends Comparable<? super U>> Comparator<T> comparing( F...
asked by 08.06.2018 / 21:56
1
answer

ArrayIndexOutOfBoundsException in Java 8 Parameters Reflection

I was doing a code with reflection in Java 8 when I came across a strange behavior - an ArrayIndexOutOfBoundsException unexpected. Based on this, I've decided to create a minimal, complete, and verifiable example. First look at this co...
asked by 18.03.2015 / 15:21