Java Lambda performance vs declared Suppliers/Functions

I am starting to learn how to develop with Optional in java8. It might be it is somwehere documented, but I have been using google with no accurate result.

I have different possible implementations for the orElseGet method, and I am not sure if java makes a better memory handling in some case, or if its pretty much the same.

Lets say I have a method in a class with an Optional defined:

class myClass {

final static private Supplier MY_SUPPLIER = () -> new Object();

private void myMethod1 () {

Optional x; // somehow Initialized


Read More »

By: StackOverFlow - Tuesday, 6 November

Related Posts