Object return type

How do I specify the return type of a variable or function as an Object? (By Object here I mean the instance of a class and not a singleton object)

Like that:

class TheClass

val something1: TheClass = ???

def something2: TheClass = ???

“AnyRef” is the equivalent of java’s Object type.

1 Like