# "class object" vs. "classobject" vs. "object"

**URL:** <https://discuss.kotlinlang.org/t/class-object-vs-classobject-vs-object/513>\
**Category:** Uncategorized\
**Created:** [August 12, 2014, 2:53pm UTC](https://discuss.kotlinlang.org/t/class-object-vs-classobject-vs-object/513 "2014-08-12T14:53:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)\
**Post date:** [August 12, 2014, 2:53pm UTC](https://discuss.kotlinlang.org/t/class-object-vs-classobject-vs-object/513/1 "2014-08-12T14:53:48Z")

</div>

As far as I understand "http://kotlinlang.org/docs/reference/classes.html"\>class object" is meant to be a single term and not a class named "object", but that is exactly what it looks like at first! Wouldn't it be possible to eleminate the word "class" from class objects? The single anonymous object within a class would then be the class object.

Instead of

&nbsp;&nbsp;class C() {   
 &nbsp;&nbsp;class object {   
 &nbsp;&nbsp;fun create() = C()   
 &nbsp;&nbsp;}   
&nbsp;&nbsp;}

simply

&nbsp;&nbsp;class C() {  
 &nbsp;&nbsp;object {  
 &nbsp;&nbsp;fun create() = C()  
 &nbsp;&nbsp;}  
&nbsp;&nbsp;}

But probably it’s too late for such changes …

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [August 12, 2014, 3:12pm UTC](https://discuss.kotlinlang.org/t/class-object-vs-classobject-vs-object/513/2 "2014-08-12T15:12:24Z")

</div>

Well, the class object syntax is likely to be reconsidered, although not exactly along those lines you are suggesting. We will consider your proposal too, though.

---

<div class="post-metadata">

**Author:** ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)\
**Post date:** [August 13, 2014, 5:34pm UTC](https://discuss.kotlinlang.org/t/class-object-vs-classobject-vs-object/513/3 "2014-08-13T17:34:05Z")

</div>

Good to know, that you want to rethink class objects.

Since class objects are not inherited (what wouldn’t make much sense), it would be plausible to place them outside of the class like Scalas companion objects. It would be obvious then, that the companion object wouldn’t be inherited.
