scala

class Symbol

[source: scala/Symbol.scala]

@serializable

final class Symbol(val name : java.lang.String)
extends AnyRef

This class provides a simple way to get unique objects for equal strings. Since symbols are interned, they can be compared using reference equality. Instances of Symbol can be created easily with Scala's built-in quote mechanism.

For instance, the Scala term 'mysym will invoke the constructor of the Symbol class in the following way: Symbol("mysym").

Author
Martin Odersky, Iulian Dragos
Version
1.8
Method Summary
override def toString : java.lang.String
Converts this symbol to a string.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def toString : java.lang.String
Converts this symbol to a string.