That’s part of the syntax of the new lambda expressions, to be introduced in Java 8. There are a couple of online tutorials to get the hang of it, here’s a link to one. Basically, the ->
separates the parameters (left-side) from the implementation (right side).
The general syntax for using lambda expressions is
(Parameters) -> { Body }
where the ->
separates parameters and lambda expression body.
The parameters are enclosed in parentheses which is the same way as for methods and the lambda expression body is a block of code enclosed in braces.
Related Posts:
- Error:java: javacTask: source release 8 requires target release 1.8
- Java “lambda expressions not supported at this language level”
- IntelliJ: Error:java: error: release version 5 not supported
- Exception in thread “main” java.lang.ClassNotFoundException:
- Java 8 Iterable.forEach() vs foreach loop
- What’s the difference between map() and flatMap() methods in Java 8?
- Lombok and Maven
- typeof in Java 8
- Package name does not correspond to the file path – IntelliJ
- Error: Could not find or load main class in intelliJ IDE
- How to install Java 8 on Mac
- :: (double colon) operator in Java 8
- java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing in Intellij
- What are .iml files in Android Studio?
- LocalDate to java.util.Date and vice versa simplest conversion?
- Java file outside of source root intelliJ
- unused import statement for used ones in IntelliJ IDEA
- Range of valid character for a base 64 encoding
- Error: JavaFX runtime components are missing, and are required to run this application with JDK 11
- Reason for the exception java.lang.VerifyError: Bad type on operand stack
- Where to get the tools.jar to use with the Java 8 jdk early release
- Converting between java.time.LocalDateTime and java.util.Date
- How to fix “unsupported class file major version 60” in IntelliJ?
- intellij incorrectly saying no beans of type found for autowired repository
- JAVA_HOME should point to a JDK not a JRE
- IDEA: javac: source release 1.7 requires target release 1.7
- Eclipse error: indirectly referenced from required .class files?
- IntelliJ – Can’t start – “JAVA_HOME does not point to a valid JVM installation”
- Creating Jar with Intellij 2016 – No main manifest attribute
- Failed to create a child event loop
- Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project
- How to convert an Instant to a date format?
- Error: Module not specified (IntelliJ IDEA)
- Invalid signature file digest for Manifest main attributes exception while trying to run jar file
- What is the best Java email address validation method?
- Using JavaFX in JRE 8, “Access restriction” error
- Intellij – Unable to use newer Java 8 classes – Error : “Usage of API documented as @since 1.6+..”
- “Cannot start compilation: the output path is not specified for module…”
- What is the purpose of the default keyword in Java?
- intellij idea – Error: java: invalid source release 1.9
- String index out of bounds exception java
- Issue installing Netbeans in Windows 10: Java SE Development Kit (JDK) was not found on this computer
- Class JavaLaunchHelper is implemented in two places
- IntelliJ IDEA “The selected directory is not a valid home for JDK”
- What does Java option -Xmx stand for? [duplicate]
- How do I convert a String to an int in Java?
- What does Java option -Xmx stand for? [duplicate]
- Is there an invisible character that is not regarded as whitespace?
- Problem with gif with transparent background
- Finding white rectangle in an image
- 1000 * 60 * 60 * 24 * 30 results in a negative number [duplicate]
- How to convert nanoseconds to seconds using the TimeUnit enum?
- Search for words with telephone numbers from 2-3-4 tree
- Using or ‘|’ in regex [duplicate]
- How to format strings in Java
- What is the difference between x86 and x64
- && (AND) and || (OR) in IF statements
- How to use the toString method in Java?
- What is a NullPointerException, and how do I fix it?
- What exactly is Apache Camel?
- Unable to find valid certification path to requested target – error even after cert imported
- Unable to find valid certification path to requested target – error even after cert imported
- What is the equivalent of the C++ Pair
in Java? - Java – Convert integer to string [duplicate]
- Getting random numbers in Java [duplicate]
- What is an instance variable in Java?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Java: “error: cannot find symbol”
- How does the Java ‘for each’ loop work?
- Which is the difference between Long.valueOf(0) and 0L in Java?
- What is a StackOverflowError?
- What are the differences between a HashMap and a Hashtable in Java?
- Use of “instanceof” in Java [duplicate]
- How to use Collections.sort() in Java?
- How to uninstall Eclipse?
- Is GNU’s Java Compiler (GCJ) dead? [closed]
- How does System.out.print() work?
- How do I “decompile” Java class files? [closed]
- How do I determine whether an array contains a particular value in Java?
- How to initialize an array in Java?
- How does the Java ‘for each’ loop work?
- Initialize part of an array in java
- How can I solve Exception in thread “main” java.lang.NullPointerException error [duplicate]
- How to split a string in Java
- What does “Could not find or load main class” mean?
- What does “Could not find or load main class” mean?
- Why am I getting a NoClassDefFoundError in Java?
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- Eclipse/Maven error: “No compiler is provided in this environment”
- How do I compare strings in Java?
- Is Java “pass-by-reference” or “pass-by-value”?
- What is reflection and why is it useful?
- Implementing UML diagram to Java [closed]
- How to round a number to n decimal places in Java
- Using Pairs or 2-tuples in Java [duplicate]
- How do I create a file and write to it?
- Could not reserve enough space for object heap
- Difference between java.exe and javaw.exe
- When to use LinkedList over ArrayList in Java?