Why illegal start of declaration in Scala?

Viewed 14576

For the following code:

package FileOperations
import java.net.URL

object FileOperations {
    def processWindowsPath(p: String): String {
        "file:///" + p.replaceAll("\\", "/")
    }
}

Compiler gives an error:

> scalac FileOperations.scala
FileOperations.scala:6: error: illegal start of declaration
        "file:///" + p.replaceAll("\\", "/")

Why? How to fix?

2 Answers
Related