# Non-private fields

**URL:** <https://discuss.kotlinlang.org/t/non-private-fields/4031>\
**Category:** Uncategorized\
**Created:** [August 4, 2017, 11:24am UTC](https://discuss.kotlinlang.org/t/non-private-fields/4031 "2017-08-04T11:24:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![atrix0ne](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@atrix0ne](https://discuss.kotlinlang.org/u/atrix0ne)\
**Post date:** [August 4, 2017, 11:24am UTC](https://discuss.kotlinlang.org/t/non-private-fields/4031/1 "2017-08-04T11:24:51Z")

</div>

About [https://kotlinlang.org/docs/reference/comparison-to-java.html](https://kotlinlang.org/docs/reference/comparison-to-java.html)  
I am studying the differences between java and kotlin but i dont understand the part about :

What Java has that Kotlin does not -  
Non private fields

.What is the difference between java and kolitn about non private fields? where can i read something about it?thanks!

---

<div class="post-metadata">

**Author:** ![jstuyts](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jstuyts/32/2141_2.png) [@jstuyts](https://discuss.kotlinlang.org/u/jstuyts)\
**Post date:** [August 4, 2017, 11:53am UTC](https://discuss.kotlinlang.org/t/non-private-fields/4031/2 "2017-08-04T11:53:17Z")

</div>

Kotlin has properties instead of fields. A property can have different visibility for its getter and setter, where the getter must be at least as visible as the setter. Each property is backed by a field (if the compiler determines that the field is needed) which is always private. So, no non-private fields.

Kotlin simply forces access to a field through its getter and setter, so there is no need to give the field more visibility than private to be able to access it.

See: [http://kotlinlang.org/docs/reference/properties.html](http://kotlinlang.org/docs/reference/properties.html)
