Excellent work! In this lesson, we’ve learned the following concepts:
classkeyword followed by a name and optional body.
(), and any necessary arguments.
initblock gets invoked with every instance creation and is used to add logic to the class.
You did it! 🎉 You’ve completed the last lesson in the Learn Kotlin course. You should be immensely proud of yourself and your accomplishments. This was no easy feat, but you’ve made it to DevCity and can proudly say you’re on track to becoming a master of the Kotlin language.
Run the code on the right and enter the following two commands for a special message from Codey:
kotlinc Congratulations.kt -include-runtime -d Congratulations.jar
java -jar Congratulations.jar