# Коtlin docs example

**URL:** https://discuss.kotlinlang.org/t/tlin-docs-example/2096
**Category:** Uncategorized
**Created:** [November 17, 2016, 7:17am UTC](https://discuss.kotlinlang.org/t/tlin-docs-example/2096 "2016-11-17T07:17:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![olegkoksharov](https://avatars.discourse-cdn.com/v4/letter/o/41988e/32.png) [@olegkoksharov](https://discuss.kotlinlang.org/u/olegkoksharov)
#### Post date: [November 17, 2016, 7:17am UTC](https://discuss.kotlinlang.org/t/tlin-docs-example/2096/1 "2016-11-17T07:17:40Z")

</div>

Hello, I’m new to Java and Kotlin. So, I opened kotlin-docs and found the topic “Using nullable values and checking for null”.  
My question is, what should I do with function “parseInt”, that the example to work correctly.  
If i copy the full example, IDEA says that i need to return something in function with block body, and it’s right.  
So, should i check string on “hold an integer” and return null or Int? and why we need “parseInt” function or i don’t understand something? 🙂

Thank you for your attention.

---

<div class="post-metadata">

### Author: ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)
#### Post date: [November 17, 2016, 7:33am UTC](https://discuss.kotlinlang.org/t/tlin-docs-example/2096/2 "2016-11-17T07:33:23Z")

</div>

This code snippet, like many other examples in the documentation, is not intended to be a full runnable example. All it is showing is that you can use a nullable return type for such a function, and how the function can be declared.

---

<div class="post-metadata">

### Author: ![olegkoksharov](https://avatars.discourse-cdn.com/v4/letter/o/41988e/32.png) [@olegkoksharov](https://discuss.kotlinlang.org/u/olegkoksharov)
#### Post date: [November 17, 2016, 8:06am UTC](https://discuss.kotlinlang.org/t/tlin-docs-example/2096/3 "2016-11-17T08:06:17Z")

</div>

I just thought that this magic function itself checks string on “hold an integer” and return null, if it’s not integer. 🙂 Will continue to learn Kotlin.  
Thank you for your answer.
