java "->"
interface LambdaFunction {
void call();
}
class FirstLambda {
public static void main(String []args) {
LambdaFunction lambdaFunction = () -> System.out.println("Hello world");
lambdaFunction.call();
}
}Runnable r = ()-> System.out.print("Run method");
// is equivalent to
Runnable r = new Runnable() {
@Override
public void run() {
System.out.print("Run method");
}
};
Also in Java:
- java create window
- adding an element to the end of a linked list java
- @JsonSerializer spring specific field string to date
- remove item from arraylist in java
- how to find length of array in java
- how to scan a character in java
- java initialize string array
- java hashmap set value
- converter int array para string java
- how to remove all items from alist in java
- fibonacci sequence in java recursion
- how to initiate a queue in java
- java 8 seconds to days
- java 8 list stream delete by name
- how to make a loop in java
- bukkit java get max players
- entre clavier java
- loop java
- spigot get player from UUID
- java regex replace all characters before
- java parse xml string
- java observable to observer stack overflow
- how to check if a string contains only alphabets and space in java
- android get distance between two locations kotlin