# notNull delegate vs lateinit

**URL:** <https://discuss.kotlinlang.org/t/notnull-delegate-vs-lateinit/1923>\
**Category:** Android\
**Created:** [August 15, 2016, 6:44pm UTC](https://discuss.kotlinlang.org/t/notnull-delegate-vs-lateinit/1923 "2016-08-15T18:44:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yanex](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yanex/32/1489_2.png) [@yanex](https://discuss.kotlinlang.org/u/yanex)\
**Post date:** [August 15, 2016, 10:53pm UTC](https://discuss.kotlinlang.org/t/notnull-delegate-vs-lateinit/1923/2 "2016-08-15T22:53:06Z")

</div>

- `notNull` creates an extra object for each property. The object is small, but if you have lots of properties, it can be significant for you.
- You can’t use the `notNull` delegate with external injection tools that injects directly to Java fields;
- You can’t create a `lateinit` property of the primitive type (`Int`, `Long`, etc).

`lateinit` is cheaper, but you can use only the delegate when your property has a primitive type.

---

_[View the full topic](https://discuss.kotlinlang.org/t/notnull-delegate-vs-lateinit/1923)._
