scala
package scala
- Alphabetic
- By Inheritance
- scala
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type ::[A] = scala.collection.immutable.::[A]
- type AbstractMethodError = java.lang.AbstractMethodError
-
abstract
class
Any
Class
Any
is the root of the Scala class hierarchy.Class
Any
is the root of the Scala class hierarchy. Every class in a Scala execution environment inherits directly or indirectly from this class.Starting with Scala 2.10 it is possible to directly extend
Any
using universal traits. A universal trait is a trait that extendsAny
, only hasdef
s as members, and does no initialization.The main use case for universal traits is to allow basic inheritance of methods for value classes. For example,
trait Printable extends Any { def print(): Unit = println(this) } class Wrapper(val underlying: Int) extends AnyVal with Printable val w = new Wrapper(3) w.print()
See the Value Classes and Universal Traits for more details on the interplay of universal traits and value classes.
- type ArrayIndexOutOfBoundsException = java.lang.ArrayIndexOutOfBoundsException
- type BigDecimal = scala.math.BigDecimal
- type BigInt = scala.math.BigInt
- type BufferedIterator[+A] = scala.collection.BufferedIterator[A]
- type ClassCastException = java.lang.ClassCastException
- type Either[+A, +B] = scala.util.Either[A, B]
- type Equiv[T] = scala.math.Equiv[T]
- type Error = java.lang.Error
- type Exception = java.lang.Exception
- type Fractional[T] = scala.math.Fractional[T]
- type IllegalArgumentException = java.lang.IllegalArgumentException
- type IndexOutOfBoundsException = java.lang.IndexOutOfBoundsException
- type IndexedSeq[+A] = scala.collection.IndexedSeq[A]
- type Integral[T] = scala.math.Integral[T]
- type InterruptedException = java.lang.InterruptedException
- type Iterable[+A] = scala.collection.Iterable[A]
- type Iterator[+A] = scala.collection.Iterator[A]
- type Left[+A, +B] = scala.util.Left[A, B]
- type List[+A] = scala.collection.immutable.List[A]
- type NoSuchElementException = java.util.NoSuchElementException
-
abstract final
class
Nothing
extends Any
Nothing
is - together with scala.Null - at the bottom of Scala's type hierarchy.Nothing
is - together with scala.Null - at the bottom of Scala's type hierarchy.Nothing
is a subtype of every other type (including scala.Null); there exist no instances of this type. Although typeNothing
is uninhabited, it is nevertheless useful in several ways. For instance, the Scala library defines a value scala.collection.immutable.Nil of typeList[Nothing]
. Because lists are covariant in Scala, this makes scala.collection.immutable.Nil an instance ofList[T]
, for any element of typeT
.Another usage for Nothing is the return type for methods which never return normally. One example is method error in scala.sys, which always throws an exception.
-
abstract final
class
Null
extends AnyRef
Null
is - together with scala.Nothing - at the bottom of the Scala type hierarchy.Null
is - together with scala.Nothing - at the bottom of the Scala type hierarchy.Null
is a subtype of all reference types; its only instance is thenull
reference. SinceNull
is not a subtype of value types,null
is not a member of any such type. For instance, it is not possible to assignnull
to a variable of type scala.Int. - type NullPointerException = java.lang.NullPointerException
- type NumberFormatException = java.lang.NumberFormatException
- type Numeric[T] = scala.math.Numeric[T]
- type Ordered[T] = scala.math.Ordered[T]
- type Ordering[T] = scala.math.Ordering[T]
- type PartialOrdering[T] = scala.math.PartialOrdering[T]
- type PartiallyOrdered[T] = scala.math.PartiallyOrdered[T]
- type Range = scala.collection.immutable.Range
- type Right[+A, +B] = scala.util.Right[A, B]
- type RuntimeException = java.lang.RuntimeException
- type Seq[+A] = scala.collection.Seq[A]
- type Stream[+A] = scala.collection.immutable.Stream[A]
- type StringBuilder = scala.collection.mutable.StringBuilder
- type StringIndexOutOfBoundsException = java.lang.StringIndexOutOfBoundsException
- type Throwable = java.lang.Throwable
- type Traversable[+A] = scala.collection.Traversable[A]
- type TraversableOnce[+A] = scala.collection.TraversableOnce[A]
- type UnsupportedOperationException = java.lang.UnsupportedOperationException
- type Vector[+A] = scala.collection.immutable.Vector[A]
Value Members
- val #::: scala.collection.immutable.Stream.#::.type
- val +:: scala.collection.+:.type
- val :+: scala.collection.:+.type
- val ::: scala.collection.immutable.::.type
- val AnyRef: Specializable
- val BigDecimal: scala.math.BigDecimal.type
- val BigInt: scala.math.BigInt.type
- val Either: scala.util.Either.type
- val Equiv: scala.math.Equiv.type
- val Fractional: scala.math.Fractional.type
- val IndexedSeq: scala.collection.IndexedSeq.type
- val Integral: scala.math.Integral.type
- val Iterable: scala.collection.Iterable.type
- val Iterator: scala.collection.Iterator.type
- val Left: scala.util.Left.type
- val List: scala.collection.immutable.List.type
- val Nil: scala.collection.immutable.Nil.type
- val Numeric: scala.math.Numeric.type
- val Ordered: scala.math.Ordered.type
- val Ordering: scala.math.Ordering.type
- val Range: scala.collection.immutable.Range.type
- val Right: scala.util.Right.type
- val Seq: scala.collection.Seq.type
- val Stream: scala.collection.immutable.Stream.type
- val StringBuilder: scala.collection.mutable.StringBuilder.type
- val Traversable: scala.collection.Traversable.type
- val Vector: scala.collection.immutable.Vector.type