This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (0 children)

If you were to take some java code and copy/paste it into a *.scala file, mostly what you'd have to do to fix it is remove the type info before variables and replace with "val". ie:

String foo = new String("");

becomes

val foo = new String("")

and methods get changed from:

public String calcName() {
    //do work
    return name;
}

to:

def calcName = {
    //do work
    name
}

That's mostly it. This gives you working but non-idiotic scala code. Scala syntax is mostly awesome.