Kotlin Essential Training: Functions, Collections, and I/O
4h 43mBeginner2022-04-29
Authors

Nate Ebel
Staff Engineer, Google Developer Expert, and Podcast Host
Course details
If you’re looking to get up and running with Kotlin, the powerful programming language from JetBrains, this course gives you the tools you need to start writing command-line programs in a matter of hours. Join instructor Nate Ebel, the author of Mastering Kotlin, as he shows you the ins and out of Kotlin and walks you through its unique selling points for developers—from null safety and concise syntax to Java compatibility, to full support by Google for Android development.
Get a comprehensive overview of writing code in Kotlin, including the basics of data types, variables, statements, expressions, functions, and classes. Learn how to use the essential features of this powerful, interoperable language as well as effectively debug your code. Along the way, Nate gives you expert pointers on how to write safe and efficient multithreaded code using Kotlin coroutines to manage multiple tasks at the same time.
Get a comprehensive overview of writing code in Kotlin, including the basics of data types, variables, statements, expressions, functions, and classes. Learn how to use the essential features of this powerful, interoperable language as well as effectively debug your code. Along the way, Nate gives you expert pointers on how to write safe and efficient multithreaded code using Kotlin coroutines to manage multiple tasks at the same time.
Skills covered
KotlinEssential TrainingProgramming LanguagesOpen SourceSoftware Development
Concepts
Introduction
- Welcome to Kotlin
- What you should know
- Using the exercise files on GitHub
Setting Up Your Kotlin Development Environment
- Introducing IntelliJ IDEA
- Installing IntelliJ IDEA for macOS
- Installing IntelliJ IDEA for Windows
- Run your first Kotlin code
Common Data Types
- Mutable and immutable data types
- Numeric data types
- Char and string data types
- Nullable types
Working with Functions
- Basic functions
- Function parameters
- Functional types
- Higher-order functions
- Challenge - Write a name formatter function
- Solution - Write a name formatter function
Control Flow Structures
- if and when statements
- Statements vs. expressions
- try catch as control flow
- Smart casting
- while loops
- for loops
- Challenge - Replace an if else expression with a when expression
- Solution - Replace an if else expression with a when expression
Debugging Kotlin Code
- Setting breakpoints
- Stepping through code
- Evaluate expressions and add watches
Working with Collections
- Arrays
- Lists
- Sets and maps
- Working with collections
- Sequences
- Challenge - Filtering a list of data
- Solution - Filtering a list of data
Working with Inputs and Outputs
- Command-line arguments
- Receiving user input
- Read and write to files
- Challenge - Parsing a list of data from a file
- Solution - Parsing a list of data from a file
Testing Kotlin Code
- Writing JUnit tests
- Mocking data
Conclusion
- Next steps