With closures being added to Java, what is Scala’s advantage over Java as a language choice?
Can someone elaborate on any advantages?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Apart from closures (which Java doesn’t appear all that close to having), here’s a list of features in Scala that are missing from Java. I’ll omit libraries here and concentrate on the features of the language itself. This is not comprehensive by any means, but I think it contains the big ticket items.
forcomprehensionsvals are as easy to declare asvars)Some cool secondary constructs that these building blocks enable:
Lastly, I’ll mention that Scala has a REPL (read-evaluate-print-loop)–not really a feature of the language itself, but it’s very nice to have!