title: Scala private function
body: <p>I came across a code snippet in Scala that looked like this:</p>
  
  <pre><code>final class Test private (fn: Int =&gt; Int) {
    def square(i: Int) = i * i
   }
  
   object Test {
     def apply(fn: Int =&gt; Int) = new Test(fn)
   }
  </code></pre>
  
  <p>What would that mean? I could not find any references to this in the text materials that I have on Scala.</p>
  
  <p>Edit: Found what I wanted in this link:</p>
  
  <p><a href="https://www.safaribooksonline.com/library/view/scala-cookbook/9781449340292/ch04s05.html" rel="nofollow">https://www.safaribooksonline.com/library/view/scala-cookbook/9781449340292/ch04s05.html</a></p>