About 11,400,000 results
Open links in new tab
  1. Does Java support default parameter values? - Stack Overflow

    Function<Integer,Function<Integer,Integer>> mutiply = a->{ return b -> a*b; }; Let's Simplify and understand the above method. The Above method accepts only One integer Argument and …

  2. What does the arrow operator, '->', do in Java? - Stack Overflow

    Details: Java 6, Apache Commons Collection, IntelliJ 12. Update/Answer: It turns out that IntelliJ 12 supports Java 8, which supports lambdas, and is "folding" Predicates and displaying them …

  3. double colon) operator in Java 8 - Stack Overflow

    Nov 15, 2013 · In Java 8, Streams Reducer works as a function which takes two values as input and returns the result after some calculation. This result is fed into the next iteration. In case of …

  4. java - Calculating powers of integers - Stack Overflow

    Without using pow function and +ve and -ve pow values. ... Java has function named pow in the Math class ...

  5. function - How to return 2 values from a Java method? - Stack …

    May 14, 2010 · First, it would be better if Java had tuples for returning multiple values. Second, code the simplest possible Pair class, or use an array. But, if you do need to return a pair, …

  6. Benefit of using Java Function rather than normal method?

    Aug 11, 2021 · The Function Interface is introduced in Java 8, to implement functional programming in Java. It represents a function that takes in one argument and produces a …

  7. java - How to serialize a lambda? - Stack Overflow

    interface SerializableFunction<T,R> extends Function<T,R>, Serializable {} interface SerializableConsumer<T> extends Consumer<T>, Serializable {} then the method accepting …

  8. How to pass a function as a parameter in Java? [duplicate]

    Thanks to Java 8 you don't need to do the steps below to pass a function to a method, that's what lambdas are for, see Oracle's Lambda Expression tutorial. The rest of this post describes what …

  9. java - how to set default method argument values ... - Stack …

    Is it possible to set the default method parameter values in Java? Example: If there is a method public int doSomething(int arg1, int arg2) { //some logic here return 0; } is it possible to m...

  10. function - How to return a boolean method in java? - Stack Overflow

    Jan 5, 2017 · Edit: Sometimes you can't return early because there's more work to be done. In that case you can declare a boolean variable and set it appropriately inside the conditional …