# What is the advantage of "companion object" vs static keyword

**URL:** <https://discuss.kotlinlang.org/t/what-is-the-advantage-of-companion-object-vs-static-keyword/4034>\
**Category:** Language Design\
**Created:** [August 4, 2017, 4:25pm UTC](https://discuss.kotlinlang.org/t/what-is-the-advantage-of-companion-object-vs-static-keyword/4034 "2017-08-04T16:25:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![elizarov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/elizarov/32/2164_2.png) [@elizarov](https://discuss.kotlinlang.org/u/elizarov)\
**Post date:** [August 4, 2017, 5:28pm UTC](https://discuss.kotlinlang.org/t/what-is-the-advantage-of-companion-object-vs-static-keyword/4034/2 "2017-08-04T17:28:38Z")

</div>

If you follow the style of writing the statics at the top of the class in Java, then I suggest to try to consider writing them _at the top level_ (e.g. before class declaration) in Kotlin. For many use-cases it works better than introducing a `companion object`.

---

_[View the full topic](https://discuss.kotlinlang.org/t/what-is-the-advantage-of-companion-object-vs-static-keyword/4034)._
