Conclusion

11. Conclusion

Great job on completing this introduction to Kotlin!

You worked with simple programs in Kotlin and ran them to see text printed to the output. You modified the programs in different ways and observed how those changes affected the output. It's normal to make mistakes when programming, so you also began to learn about how to troubleshoot and correct errors in your code, which is an important skill that will help you in the future.

Move on to the next codelab to learn how to use variables in Kotlin so that you can create more interesting programs!

Summary

  • A Kotlin program requires a main function as the entry point of the program.
  • To define a function in Kotlin, use the fun keyword, followed by the name of the function, any inputs enclosed in parentheses, followed by the function body enclosed in curly braces.
  • The name of a function should follow camel case convention and start with a lowercase letter.
  • Use the println() function call to print some text to the output.
  • Refer to the Kotlin style guide for formatting and code conventions to follow when coding in Kotlin.
  • Troubleshooting is the process of resolving errors in your code.

Learn more

Back
Done

Comments

Popular

Text/Html

Code

Section id

Organisation/Company

Tested Pages

Exercises

Privacy Policy