:
class Test{}
object Driver extends Test{
}
:
abstract Fruit{
val name :String
val color :String
}
object Fruit{
object Apple extends Fruit("apple","red")
val menu=List(Apple)
}
question:
(1) Why object in scala can also inherit from class or trait using extends. How to understand
(2) Why does extens Fruit ("A", "B") take two parameters here in the second paragraph of code?
Thank you for answering questions!
add: