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”
- Problem with gif with transparent background
- Search for words with telephone numbers from 2-3-4 tree
- What’s the C++ version of Java’s ArrayList
- Java Could not reserve enough space for object heap error
- Getting “java.io.IOException: An existing connection was forcibly closed by the remote host”
- Java string to date conversion
- Creating a “logical exclusive or” operator in Java
- Cannot make a static reference to the non-static method fxn(int) from the type Two [duplicate]
- What is IllegalStateException?
- Long vs Integer, long vs int, what to use and when?
- Java Using Nodes with LinkedList
- When is the @JsonProperty property used and what is it used for?
- What is the difference between String.subString() and String.subSequence()
- Why Maven project is tied to J2SE-1.5 by default?
- Difference in System. exit(0) , System.exit(-1), System.exit(1 ) in Java
- Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupported major.minor version 51.0)
- How to compare two double values in Java?
- Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0 error in Java
- How to override compareTo (Java)
- package does not exist error!
- Required: Variable Found: Value
- Java class “cannot be resolved to a type”
- What does the colon (:) operator do?
- Shifting array to the right – homework
- How to get rid of Checkstyle message ‘File does not end with a newline.’
- trying to fix java Exception in thread “JavaFX Application Thread” java.lang.NullPointerException
- How can I edit a .jar file?
- java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Exception occurring. Why?
- This Activity already has an action bar supplied by the window decor?
- Convert hex string to int
- Orphaned Case Error in Java
- Proxy Error 502 : The proxy server received an invalid response from an upstream server
- How to make a countdown timer in Java
- How to set String’s font size, style in Java using the Font class?
- (Java) Tic-Tac-Toe game using 2 dimensional Array
- Java syntax explanation – getMenuInflater()
- Incompatible types List of List and ArrayList of ArrayList
- Tomcat 8 Maven Plugin for Java 8
- Dice Rolling java program
- int cannot be converted to int []
- Joda DateTime to Timestamp conversion
- How to use a Do-while loop that continuously prompts a user?
- How can my Gradle build initialize class org.codehaus.groovy.classgen.Verifier?
- Java equivalent of unsigned long long?
- Getting “unixtime” in Java
- How do I break out of nested loops in Java?
- How do I convert this for loop into a while loop?
- Java switch statement: Constant expression required, but it IS constant
- Collision Detection between two images in Java
- What does .pack() do?
- String is immutable. What exactly is the meaning?
- How do I autoindent in Netbeans?
- What is an attribute in Java?
- KeyPressed event in java
- MessageBodyWriter not found for media type=application/json
- Conversion from Long to Double in Java