How do I call a Java method named the same as a Scala keyword? [duplicate]
Possible Duplicate:
Using Java Lib with Scala Reserved Words
I'm experimenting with Scala, and a Java library I'm using has a with
method on one of its objects, but with
is a keyword in Scala. How do I call this method from my Scala code?
From http://ofps.oreilly.com/titles/9780596155957/TypeLessDoMore.html#ReservedWords
Some Java methods use names that are reserved by Scala, e.g., java.util.Scanner.match. To avoid a compilation error, surround the name with single back quotes, e.g., java.util.Scanner.‵match‵.
(edited for formatting)
精彩评论