title: Kotlin: How to access field from another class?
body: <pre><code>package example
  
  class Apple {
      val APPLE_SIZE_KEY: String = "APPLE_SIZE_KEY"
  }
  </code></pre>
  
  <p>Class:</p>
  
  <pre><code>package example
  
  class Store {
       fun buy() {
        val SIZE = Apple.APPLE_SIZE_KEY
      }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>'APPLE_SIZE_KEY' has private access in 'example.Apple'</p>
  </blockquote>
  
  <p>But <a href="https://kotlinlang.org/docs/reference/visibility-modifiers.html#classes-and-interfaces" rel="noreferrer">official documentation</a> describes that if we do not specify any visibility modifier, <code>public</code> is used by default.</p>
  
  <p>Why is above error coming?</p>