Page 245 (PDF page 285):
It states on p245:
"...import the normal Java date class as simply Date..."
Shouldn't it be SDate?
If we do as suggested; eg:
import java.sql.{Date => SDate}
and add a method to a class; eg:
def sql(date: String) : Date = { Date.valueOf(date) }
we will get a compiler error.
However, if we use SDate the compiler is happy:
def sql(date: String) : SDate = { SDate.valueOf(date) }
PS. I find the inclusion of:
import java.sql.{Date => SDate}
in the text redundant as it adds nothing to the previous example of:
import Fruits.{Apple=>McIntosh,Orange}
after reading this example we now the => mapping syntax.
|