Java symbol ( -> ) and ( = ) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Java symbol ( -> ) and ( = )

Which one you prefer? did they same?

14th Jun 2019, 2:57 PM
Tzion
Tzion - avatar
2 Answers
+ 7
-> is used in lambda expressions = is used to assign a value to a variable
14th Jun 2019, 3:05 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
you can currently see the arrow -> in the switch statement too (in Java 12 as a preview feature)
14th Jun 2019, 5:05 PM
zemiak