title: Scala Error Import
body: <p>I'm learning Scala, and I was attempting to import from 2 scrips in different classes, but, I get an error, and I don't know why.</p>
  
  <p>This class, in Summer.scala, is where I try to import the singleton object from class  ChecksumAccumulator.</p>
  
  <pre><code>import ChecksumAccumulator.calculate
  
  object Summer{
    def main(args: Array[String]): Unit= {
      for (arg &lt;- args)
        println(arg + " : " +  calculate(arg))
    }
  }
  </code></pre>
  
  <p>Class ChecksumAccumulator, with the singleton object ChecksumAccumulator.</p>
  
  <pre><code>object ChecksumAccumulator {
  
  /*
   When a singleton object shares the same name
   with a class, it is called that class's companion object. 
  */
  
    private val cache = mutable.Map.empty[String, Int]
  
    def calculate(s: String): Int =
      if (cache.contains(s))
        cache(s)
      else {
        val acc = new ChecksumAccumulator
  
        //The object with the same name of the class can acces to the private members.
        //println(acc.sum)
        for (c &lt;- s)
          acc.add(c.toByte)
        val cs = acc.checksum()
        cache += (s -&gt; cs)
        cs
      }
      def showMap() : Unit = {
        for(base:String &lt;- cache.keys)
          println(cache(base))
      }
  //def showMap(): String = { var cadena = cache("Every value is an object.") +  " "+ cache("Every value is an object. per second time!!");  cadena  }
  }
  </code></pre>
  
  <p>This script throw this mistake </p>
  
  <blockquote>
    <p>scala Summer.scala</p>
    
    <p>Summer.scala:8: error: not found: object ChecksumAccumulator import
    ChecksumAccumulator.calculate ^ Summer.scala:14: error: not found:
    value calculate println(arg + " : " + calculate(arg)) ^ two errors
    found</p>
  </blockquote>