Introduction to Kotlin for Java Developers
4.5 (320 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,524 students enrolled

Introduction to Kotlin for Java Developers

Learn Kotlin, a modern language for the JVM (now officially supported on Android!)
4.5 (320 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,524 students enrolled
Created by Dmitri Nesteruk
Last updated 9/2017
English
English [Auto]
Current price: $34.99 Original price: $49.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 5 hours on-demand video
  • 16 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Solve problems in Kotlin
  • Understand Kotlin's advantages over Java
  • Effectively leverage Kotlin's null safety and mutability guarantees
  • Speed up work with collection using Kotlin's collection operationrs
  • Have fun with a new JVM language!
Course content
Expand all 54 lectures 04:56:27
+ Introduction to Kotlin
3 lectures 11:30

A brief overview of why Kotlin is so good.

Preview 05:34

A little note about the options available for downloading and installing Kotlin.

Downloading and Installing
02:03

Let's set up the IDE and run our first Kotlin program.

Our First Kotlin Program
03:53
+ Types and Variables
5 lectures 29:07

Learn about the difference between val and var. Also: there is no new and no semicolons.

Variable Declarations
06:31

Thanks to type deduction, most variable type decorations are not necessary. Woo-hoo!

Type Inference
01:33

Ranges of values. Self-explanatory, right?

Ranges
08:20

A look at how arrays are represented and used in Kotlin.

Arrays
05:59

Strings aren't complicated, but interpolation makes them more powerful.

Strings and String Interpolation
06:44
+ Control Flow
5 lectures 22:56

Kotlin provides powerful support for dealing with nullability. Lean everything about ?, ?., ?: and !!

Nullability
08:17

Yer olde if is an expression that can return values and can appear in interpolated strings.

If Statement
03:22

Why should the IDE check if you are risking an NPE, if the compiler can do it just as well? This awesome compiler feature also takes care of type conversions and more.

Preview 02:26

This ain't your father's for loop!

For Iteration
02:55

Kotlin's powerful alternative to Java's switch.

When Expression
05:56
+ Functions
5 lectures 18:05

Kotlin has functions which are not inside any class. What is this, C++?!?

Top-Level Functions
03:15

Kotlin supports default argument values and calls with named arguments.

Return Types and Arguments
04:53

Call a function with any number of arguments, comma-separated-like.

Preview 03:03

Functions within functions.

Local (a.k.a. Nested or Inner) Functions
04:09

Explains how functions such as downTo are implemented.

Infix Functions
02:45
+ Lambda Functions
4 lectures 15:39

Yay, lambdas! Oh, wait, Java has lambdas too? Yeah, but not like these!

Warning: Kotlin lambdas may or may not be cached when passed into Java event listeners. Be careful!

Lambda Functions
06:17

Functions taking functions, but why?

Higher-Order Functions
03:15

Define the context of the function's operation. Advanced topic!

Preview 01:50

Give a class a magic method called invoke and call it like a function (a.k.a. functor).

Functors
04:17
+ Classes
10 lectures 46:27

What, no fields? With Kotlin, forget about fields and getter/setter hell: properties take care of it all!

Properties
06:33

Give any type additional functionality.

Extension Functions and Properties
06:28

Primary constructors provide an epic level of succinctness. But if you need to do more than initialize some fields, init block to the rescue!

Primary Constructors and Initialization
03:28

You can override the implementation of a property in an external class. But why?!?

Warning: when you reference this in a delegated property class, you are referring to that class, not the class where the delegated property is going to be used. Be careful!

Delegated Properties
06:29

Simple, yet powerful, data classes auto-implement the basic scaffolding for you. Don't worry, you can override anything you don't like!

Data Classes
04:04

Kotlin lets you make Singletons with ease. It doesn't have static functions, but companion objects are a close alternative.

Singleton
03:03

Kotlin doesn't have statics. But you can still get them, in a way.

Preview 05:17

Learn about the override keyword, base call disambiguation, opening types and more.

Inheritance
03:34

Interfaces... can contain properties as well as functions.

Interfaces
02:42

The Decorator pattern is essentially built-in in Kotlin.

Class Delegation
04:49
+ Collection Operations
12 lectures 01:33:15

A discussion of Kotlin collection support and why it rocks.

Preview 02:18

Let's dig into kotlin-runtime.jar and find all the classes related to collection operations as well as sequences. We'll also learn how to make sequence generators: a useful feature that we'll use throughout this entire section.

API Overview and Sequence Generators
05:23

Counting how many elements fit a predicate.

Quantifiers (any, all, count, contains)
04:59

Mapping each element to something else.

Preview 13:45

Compressing a sequence to a single value.

Aggregation (fold, reduce, joinToString)
17:55

Keeping elements satisfying (or not) a particular predicate and throwing all others away.

Filtering (filter, filterNot)
05:24

Splitting a sequence based on a criterion.

Partitioning (drop & take)
06:42

Grouping elements by a particular key.

Grouping (groupBy)
05:04

Sorting a data set by one or more of its properties.

Sorting (sortedBy, sortedWith, compareBy, thenBy)
09:24

Operations which try to access an individual element of the collection.

Element Operations (first, last, single, elementAt)
07:05

Operations on algebraic sets.

Set Operations (distinct, intersect, union, subtract)
06:15

A summary of all the collection operations we've discussed in this section of the course.

Summary
09:01
+ Reflection
5 lectures 30:06

Yeah, Java has reflection too, but can you tell if your object is a singleton or a companion object? Of course not. Kotlin reflection to the rescue!

Class Reflection
06:34

Learn to work with references to functions. Remember, functions are everywhere in kotlin. Got a property? Well, its getters/setters are functions. Also you get to see how to handle references to function overloads.

Function References
07:38

Learn to work with property references. Remember, typical val/var declarations are properties too!

Property References
06:59

Learn to work with references to class constructors.

Constructor References
02:51

Function and property references can also bind itself to an instance of the receiver.

Bound References
06:04
+ Odds & Ends
5 lectures 29:23

Type aliases provide alternative names for existing types.

Type Aliases
07:19

Yes, enumerations, with abstract functions and whatnot.

Enumerations
06:35

Kotlin has no checked exceptions. But try-catch is an expression.

Exceptions
01:58

But only standard operators, none of that F#-inspired operator <#%$> magic.

Operator Overloads
02:03

A look at how function types with receivers, together with lambda expressions, can help us make Groovy-style builders.

Type-Safe Builders
11:28
Requirements
  • A basic knowledge of Java is beneficial
Description

This is a course on the Kotlin programming language. This course is designed for people already familiar with Java who are looking for a more modern, expressive and powerful language for the JVM.

In this course, you will learn about:

  • How to install and run Kotlin and why toolability matters
  • Type inference and how it can save you a lot of time
  • Smart control flow structures that let you write more succinctly
  • Mutability options (val and var), what they mean and how to use them
  • Nullability guarantees and how they make your code more safe
  • The power of functional literals (nested functions and lambdas)
  • Powerful built-in delegation functionality
  • How to leverage Kotlin's collection operations to process data sets efficiently

... and a lot more!

This course is completely live-demo based. All the lectures are examples of real code being edited and executed using the IntelliJ IDEA Community Edition IDE.

Update: Google has just announced official support for Kotlin on Android. Congratulations to the Kotlin team!

Who this course is for:
  • Android developers wishing to learn the latest Google-approved language
  • Java developers looking for a better programming language
  • Developers looking for interesting language design ideas