|
Re: Type alias
|
Posted: Jun 24, 2016 3:57 AM
|
|
> I am unclear as to what the statement, "AnyRef is > an alias for java.lang.Object", implies. > > if AnyRef is an alias of java.lang.Object, > and AnyRef is a subclass of Any, what, if > anything, describes the relationship between Any > and java.lang.Object? > > I am beginning to learn Scala without a background in > Java, so I am invoking the international NEWBIE protection > clause. > Any is also erased to java.lang.Object. Any is a bit of compile-time fiction, aimed at eliminating the need for programmers to think about primitive types as different from objects, by making primitive type values appear as instances of classes.
|
|