In Scala, how do I extend an object with multiple classes? -
how inject app
object
being extended another?
object foo extends someclass bar { /* imports */ /* <-- want code here run if within `main` scope --> */ }
basically want take advantage of app
main class (example); without receive error:
java.lang.runtimeexception: no main class detected.
(so don't need worry defining own def main (args : array[string])
)
why not object foo extends someclass bar app
? app trait, mixed class effortlessly.
Comments
Post a Comment