title: what is the type of variables defined in enum?
body: <p>I'm new in scala, and while trying to understand below code, found lot of doubts. Please help me to understand this</p>
  <p>There is one scala file named as <code>MyEnums.scala</code>, and code present within it as follow</p>
  <pre><code>object AllEnums extends Enumeration {
  
    type Enums = Value
    val one,two,three = Value
  
    def getAllValues() : String = values.mkString(&quot;,&quot;)
  
  }
  </code></pre>
  <p>I'm new in scala, also bit confused same enumeration logic in Java too.  Trying to understand how enum defined here.</p>
  <ol>
  <li><p>Is <code>AllEnums</code> is a object of class <code>MyEnums.scala</code> ?</p>
  </li>
  <li><p>If <code>1</code> point is correct that means, <code>MyEnums.scala</code> extending class <code>MyEnums.scala</code> ?</p>
  </li>
  <li><p><code>type Enums = Value</code>, <code>Value</code> is type in scala, what's a real significance of it and what this statement <code>type Enums = Value</code> is doing  in code ?</p>
  </li>
  <li><p><code>val one,two,three = Value</code>, In this statment Is <code>= Value</code> means the values assigned to <code>val one,two,three</code> are of type <code>Value</code> ?</p>
  </li>
  <li><p><code>val one,two,three</code>, Are these instance variables of class <code>MyEnums.scala</code>, whic is nothing but of <code>Enumeration</code> Type ?</p>
  </li>
  <li><p>what's a type of these <code>val</code>s <code>one,two,three</code> ? Assigning values to these are of <code>Value</code> type, but is there any type of these variables itself <code>one,two,three</code> ?</p>
  </li>
  </ol>