title: Kotlin - How can we access private property with getter and setter? Is access methods are calling internally?
body: <pre><code>class Sample1 {
  private var test = ""
      get() = field
      set(value) {
          field = value
     }}
  </code></pre>
  
  <p>This is my class. I want to keep the property as private and have to access the property through getter and setter.</p>
  
  <pre><code> var sample1 = Sample1()
  </code></pre>
  
  <p>I tried to create an object and access the property, but fails.
  When I go through the docs, I could found one interesting thing, 
  "Getters always have the same visibility as the property". <a href="https://kotlinlang.org/docs/reference/visibility-modifiers.html" rel="noreferrer">link</a></p>
  
  <p>What's the correct approach with kotlin?</p>