title: Defining a default constructor and a secondary constructor in Kotlin, with properties
body: <p>I'm trying to make a simple POJO (POKO?) class in Kotlin, with a default empty constructor and a secondary constructor with parameters, that feeds properties</p>
  
  <p>This doesn't give me <code>firstName</code> and <code>lastName</code> properties:</p>
  
  <pre><code>class Person() {
  
      constructor(firstName: String?, lastName: String?) : this()
  }
  </code></pre>
  
  <p>This gives me the properties, but they're not set after instantiation:</p>
  
  <pre><code>class Person() {
  
      constructor(firstName: String?, lastName: String?) : this()
  
      var firstName: String? = null
      var lastName: String? = null
  }
  </code></pre>
  
  <p>And this gives me a compile error saying "'var' on secondary constructor parameter is not allowed.":</p>
  
  <pre><code>class Person() {
  
      constructor(var firstName: String?, var lastName: String?) : this()
  }
  </code></pre>
  
  <p>So, how is this done? How can I have a default constructor and a secondary constructor with parameters and properties?</p>