// Kotlin PersonClass Example // Source code file TestPerson.kt // Test the Person class in Person.kt fun main(args: Array) { // Declare and instantiate Person object. // The new operator is not used in Kotlin. var p = Person("Alice", 'F', 11) // Test getters. println("${p.name} ${p.gender} ${p.age}") // Test setter for age. p.age = 9 println(p.age) // Test haveBirthday method. p.haveBirthday( ) // Test toString method. println(p) }