
Discover how Kotlin interoperates with Java on the JVM, offering null safety, immutability, and concise syntax, and learn to build Spring Boot apps with Kotlin.
Install and configure IntelliJ community edition, create a Java hello world project with a JDK, run it, and compare IntelliJ with Eclipse using practical keyboard shortcuts.
Learn how to start a Kotlin JVM project in IntelliJ, including adding the Kotlin runtime and Java libraries, declaring variables, and preparing a first Kotlin program, exploring strings.
Explore Kotlin variable declarations with var and val, distinguishing mutable and immutable values, using colon syntax for type, and comparing Kotlin to Java as you print to the console.
Discover how Kotlin infers variable types and reduces boilerplate by declaring var name = Matt without an explicit type, and use the printline function from kotlin.io instead of system.out.printline.
Learn Kotlin string templates to simplify concatenation by inserting variables and expressions. Use curly braces for expressions, access properties and methods, and escape the dollar symbol when printing literals.
Create multi-line strings in Kotlin using triple quotes and val, then remove indentation with trimMargin and a margin prefix to produce neat output.
Declare and round an integer in Kotlin, and print its inferred kotlin.int type. Learn why Java's Integer differs from Kotlin's int and how using INT fixes the compile error.
Explore Kotlin data types like float, long, boolean, and BigDecimal, mirroring Java, with float F and long L. Learn that Kotlin lacks new and must initialize val variables before use.
Explore casting in Java by using a generic result that becomes a big decimal or a string via a random number, then cast and manipulate, and compare with Kotlin.
Learn how Kotlin handles casting between types, using is checks for smart casting and as for explicit casts, while converting Java code to Kotlin and managing var and val declarations.
Explore the Kotlin null-safe operator to safely call methods on nullable strings, printing the name in uppercase when present and null when it isn't.
Learn how the Kotlin non-null asserted operator forces a nullable variable to non-null, but it can trigger a null pointer exception and should be avoided unless needed for Spring Boot.
Explore the nothing object type in Kotlin, a type with no instances that represents values that never exist, and contrast nullable and non-nullable variables with functions and main method syntax.
Explore Kotlin function syntax, including the fun keyword, parameter declarations with colon and type, and the return type after a colon, plus the unit object as Kotlin's void equivalent.
Create and call top level functions in Kotlin, including a main function and a printer string function, with main required to be public.
Learn to call Kotlin functions with named parameters to reorder arguments, as shown with doubles 17.3 and 9.6; you must name every parameter.
Explore how Kotlin supports optional parameters with default values and named parameters to simplify function calls, replace Java-style overloading, and improve readability when supplying partial arguments.
Learn that function parameters are effectively vals, not vars; they remain immutable inside the function, so you cannot reassign them and declaring them as var won't compile.
Explore how to define functions inside functions in Kotlin, revealing visibility limits and practical uses while clarifying that inner functions are only accessible within their containing function.
Explore how Kotlin enables functions that take a lambda as a parameter, transforming a string into an int without Java's verbose function syntax, using direct lambda invocation for clarity.
Define a Kotlin class using the package, visibility, and val fields; create a customer with name, address, and age, show multiple classes in a file and public by default.
Learn how to define Kotlin constructors, replace defaults with a primary constructor using round brackets after the class name, and use shorthand to create readable public fields.
Explore Kotlin secondary constructors that complement a primary constructor, including syntax to call this, set defaults like an empty address, and how init blocks execute.
Explore how Kotlin's getters and setters map to bytecode and how to override them with the field keyword to guard changes, like approving a customer only when age is 21.
Explore how Kotlin uses a companion object to define static functions, including a static factory method get instance to create a dummy customer.
Explore how kotlin data classes reduce boilerplate by auto-generating tostring, hashcode, equals, and a copy function for primary constructor properties, and learn practical usage with a customer example.
Learn destructuring and componentN functions in Kotlin, with data classes providing them by default, and explore defining component functions in regular classes; finish with a Java-to-Kotlin conversion exercise.
Recreate a Java Person class and its main function in Kotlin, emphasizing null-safety, immutable fields, getters, and a static method, without relying on automatic code conversion.
Walk through building a Kotlin person class, choosing between class and data class, using a default constructor with a nullable date of birth, and a companion object to compute age.
Learn how to assign a variable using an if expression in Kotlin, comparing John and Jane's ages to determine the older person.
Explore the Elvis operator in Kotlin as a succinct null safety shortcut, returning age or minus one when age is null, contrasting with the traditional ternary approach in Java.
Learn how to use the Elvis operator to handle nullable properties in Kotlin, avoiding smart cast warnings by returning an uppercase color or a default empty string.
Convert switch logic to Kotlin's when expression, using arrows, no breaks, and comma delimited matches for concise, readable results, with when, else, and future ranges hinted.
Explore loops in Kotlin, focusing on the while loop and for loop, and note their similarity to Java, with a practical example printing 0 to 9 by incrementing x.
Learn how Kotlin implements the for-each loop over a collection with in syntax and type inference, printing each Kotlin person’s full name.
Learn how to destructure with a for loop in Kotlin, extracting id, title, and first name from a list and, later, from a map using keys and values.
Explore how Kotlin creates different ranges using down to, until, and step, and extend the concept to character ranges like A..F while printing results.
Explore Kotlin collections by contrasting mutable contents with immutable references, showing how val prevents reassignment while mutating maps and lists. Learn to create immutable lists and maps in Kotlin.
Create an immutable Kotlin list with colors defined as red, green, and blue using val colors; observe that add or remove are unavailable, and that filter returns a new list.
Create and manipulate a mutable list in kotlin using mutable list of, including empty lists with a generic type, and loop through items, then explore maps and sets.
Explore creating maps and sets in Kotlin, using immutable and mutable variants, learn the key-value syntax with to, and see examples like web colors and linked maps.
Explore Kotlin arrays as a class-based, mutable collection with get and set and zero-based indexing. See square-bracket notation and compare them to lists, immutable versions, and fixed-size considerations for performance.
Kotlin is a programming language for the JVM (and also for Javascript and native code too) which was created by JetBrains - the company behind the IntelliJ IDE. It offers a number of enhancements over Java, including that it's less verbose, has immutable variables, and almost always gets rid of the NullPointerException. Compared to other JVM languages, such as Scala, Kotlin is an easy transition for Java developers, and the Kotlin team hope that it will eventually replace Java alltogether!
In this course we learn how to code in Kotlin, with a particular focus on how to build full stack Spring Boot applications with Kotlin.
This course is aimed at existing Spring Framework Java developers who want to upgrade their skills to use Kotlin instead of (or as well as) Java.