Description
In this course, you’ll learn:
-
Kotlin as a better Java
-
Setting up a Kotlin programming environment
-
Val vs. var
-
Understanding basic Kotlin programming concepts
-
Object-oriented programming
-
Using Java from Kotlin
-
Using Kotlin from Java
-
Annotations, reflection, and DSL construction
-
Functional programming in Kotlin
Syllabus:
- Introduction
- Welcome
- What you should know
- How to use the exercise files
1. Kotlin as a Better Java
- Why a new JVM language?
2. Get Started with Kotlin
- Online
- IntelliJ IDEA
- Set up a Kotlin programming environment
3. Basic Kotlin Programming
- Val vs. var
- Type system
- Comments
- Control flow – if
- Control flow – when
- Control flow – loops
- Control flow – advanced loops
- Functions
- Packages
- Challenge: Implement fizz buzz
- Solution: Implement fizz buzz
4. Object-Oriented Programming
- Classes
- Objects
- Interfaces
- Generics
- Challenge: Create a function to return the smaller of two values
- Solution: Create a function to return the smaller of two values
5. Java Interop
- Use Java from Kotlin
- Use Kotlin from Java
6. Advanced Kotlin Features
- Operator overloading
- Annotations
- Reflection
- DSL construction
- Destructuring
- Challenge: Overload the plus and minus operators for a data class
- Solution: Overload the plus and minus operators for a data class
7. Functional Programming in Kotlin
- Functional programming
- Lambdas
- Closures
- Method chaining
- funKTionale library
- Composition
- Currying
- Partial application
- Memoization
- Challenge: Find the student with the shortest name
- Solution: Find the student with the shortest name