title: What does Void return type mean in Kotlin
body: <p>I tried to create function without returning value in Kotlin. And I wrote a function like in Java but with Kotlin syntax</p>
  
  <pre><code>fun hello(name: String): Void {
      println("Hello $name");
  }
  </code></pre>
  
  <p>And I've got an error</p>
  
  <blockquote>
    <p>Error:A 'return' expression required in a function with a
    block body ('{...}')</p>
  </blockquote>
  
  <p>After couple of changes I've got working function with nullable Void as return type. But it is not exactly what I need</p>
  
  <pre><code>fun hello(name: String): Void? {
      println("Hello $name");
      return null
  }
  </code></pre>
  
  <p>According to <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html" rel="noreferrer">Kotlin documentation</a> Unit type corresponds to the void type in Java. So the correct function without returning value in Kotlin is</p>
  
  <pre><code>fun hello(name: String): Unit {
      println("Hello $name");
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>fun hello(name: String) {
      println("Hello $name");
  }
  </code></pre>
  
  <p>The question is: What does <code>Void</code> mean in Kotlin, how to use it and what is the advantage of such usage?</p>