title: Scala private access modifier scope
body: <p>I have code with companion object and defined constructor as private:</p>
  
  <pre><code>class Person private[Person] (var age: Int, var name: String) {
    private[Person] def this(name: String) = this(0, name)
  }
  
  private class Employee(age: Int, name: String) extends Person(age, name)
  
  private class Worker(age: Int, name: String) extends Person(age, name)
  
  object Person {
    def prettyPrint(p: Person) = println("name:%s age:%s".format(p.name, p.age))
    def apply(age: Int, name: String) = new Person(age, name)
    def apply() = new Person(0, "undefined")
    def apply(age: Int, name: String, personType: String): Person = {
      if (personType == "worker") new Worker(age, name)
      else if (personType == "employee") new Employee(age, name)
      else new Person(age, name)
     }
  
  }
  </code></pre>
  
  <p>My question is why another object in same package also have access to this private constructor. I added private[this] so others didn't have access to it but nor companion had. Can I have private properties for class and companion object only ?</p>