About 560,000 results
Open links in new tab
  1. What's the difference between a method and a function?

    Sep 30, 2008 · Java & C# people would say it a method (and a function in this case is defined within a class/object). A C++ programmer might call it a function or sometimes method …

  2. Java's methods vs. functions - Stack Overflow

    So in Java there will be classes and code will be written in classes so they are called methods instead of functions, as they will be associated with objects. But in C++ you can have some …

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

    Java 8 and above. Using Java 8+ lambda expressions, if you have a class or interface with only a single abstract method (sometimes called a SAM type), for example: public interface …

  4. Does Java support inner / local / sub methods? - Stack Overflow

    Feb 9, 2014 · As noted earlier, a local class can use the local variables, method parameters, and even exception parameters that are in its scope, but only if those variables or parameters are …

  5. Does Java support default parameter values? - Stack Overflow

    method Currying is the way of converting multi-parameter functions into multiple functions each accepting a single parameter. Steps to create a Curried method. Write a function that accepts …

  6. Java Pass Method as Parameter - Stack Overflow

    Feb 3, 2010 · In Java 8, you can now pass a method more easily using Lambda Expressions and Method References. First, some background: a functional interface is an interface that has one …

  7. guava - Java method that returns a function? - Stack Overflow

    Function<T, R> TransformFunction = new MyFunction(); If your functions are related to each other, you could also encapsulate them into an enum , because enum s can implement …

  8. Function Pointers in Java - Stack Overflow

    Jul 2, 2009 · You will need to wrap your function into some object and pass the reference to that object in order to pass the reference to the method on that object. Syntactically, this can be …

  9. How do I define a method which takes a lambda as a parameter in …

    Nov 28, 2012 · Since Java 8 there is a set of commonly-used interface types in java.util.function. For this specific use case there's java.util.function.IntBinaryOperator with a single int …

  10. How do I time a method's execution in Java? - Stack Overflow

    Gathered all possible ways together into one place. Date. Date startDate = Calendar.getInstance().getTime(); long d_StartTime = new Date().getTime(); Thread.sleep ...

Refresh