
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.
Create a Kotlin hello world project inside a Java-capable workspace. Set up Kotlin and Java packages, write a top-level main function, print Hello world, and run to verify the output.
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.
Explore Kotlin's double data type, type inference, and the is keyword for type checks. See how ::class determines a variable's class and how Kotlin doubles relate to Java doubles.
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.
Review Kotlin data types and smart casting, noting no literals and that all types are objects; int represents integers. Variables must be initialized before use; as is used for casts.
Learn how Kotlin handles nullable variables by applying null checks and smart casts to safely call methods like toUpperCase, and compare approaches such as if checks versus string interpolation.
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 how Kotlin enables single expression functions. Write one line functions with fun, use equals syntax, and omit explicit return types when inferred.
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 to instantiate a Kotlin class in a main method, create a customer, and access its public attributes directly, with fields changeable via var.
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 alternative class design in Kotlin with primary and secondary constructors, var properties, and init blocks. See how default values and optional address fields enable flexible instantiation and minimal code.
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 get method on a dummy variable like next_age to return age plus one, via a val with a custom getter.
Learn how to define functions inside a Kotlin class, returning a string such as the name in uppercase, using a single-line expression body with equals and no braces.
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.
Explore how Kotlin treats if as an expression that returns a value, replacing Java's ternary, and practice single-line or multi-line forms with the return outside the if.
Learn how to assign a variable using an if expression in Kotlin, comparing John and Jane's ages to determine the older person.
Explore null-safe value assignment in Kotlin by using if checks, returning null or a value, and overcoming smart cast issues with techniques like local variables and the non-null assertion operator.
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.
Explore how the let function enables null-safe checks in Kotlin by composing a get last letter example with the Elvis operator and a color string.
Explore object equality in Kotlin and Java, comparing references with triple equals and values with dot equals, and apply this to an if statement that classifies color strings.
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.