Possible Duplicate:
val and object inside a scala class?
Is there a substantive difference between:
class Foo {
object timestamp extends java.util.Date
}
and
class Foo {
val timestamp = new java.util.Date {}
}
What does it really mean to have a class with an object field? What are they used for? Are there situations where you must use an object?
Thanks...