How would I express the following java code in scala?
a = b = c;
By the way, I’m re-assigning variables (not declaring).
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.
The closest shortcut syntax in Scala can only be used when you declare a
varorval.From the Scala Reference, Section 4.1
This doesn’t work for re-assignement to a
var. The C/Java style doesn’t work for reasons explained here: What is the Motivation for Scala Assignment Evaluating to Unit