title: Overriding toString method in Scala Enumeration
body: <p>How can I override "toString" to make this Scala code acts like the following Java code.</p>
  
  <p>Code in Scala</p>
  
  <pre><code>object BIT extends Enumeration {
       type BIT = Value
       val ZERO, ONE, ANY = Value
  
       override def toString() =
         this match {
         case ANY =&gt; "x "
         case ZERO=&gt; "0 "
         case ONE =&gt; "1 "
       }
  }
  
  val b = ONE
  println(ONE)  // returns ONE
  </code></pre>
  
  <p>Wanted toString behaviour should produce same output as the following Java code.</p>
  
  <pre><code>public enum BIT {
      ZERO, ONE, ANY;
  
      /** print BIT as 0,1, and X */
      public String toString() {
          switch (this) {
          case ZERO:
              return "0 ";
          case ONE:
              return "1 ";
          default://ANY
              return "X ";
          }
      }
  }
  
  BIT b = ONE;
  System.out.println(b); // returns 1
  </code></pre>
  
  <p>I think I am overriding the wrong "toString" method.</p>