Is there a way to extends another class from an Anonymous class in Scala? I means something like
abstract class Salutation {
def saybye(): String = "Bye"
}
class anotherClass() {
def dummyFunction() = {
val hello = new {
def sayhello(): String = "hello"
} extends Salutation
val hi = hello.sayhello //hi value is "Hello"
val bye = hello.saybye //bye value is "bye"
}
}