The Kotlin syntax is much easier to work with and simpler to write.
- [Instructor] So we've already written…this part here, effectively.…That is what's now in our utilities,…and I guess the obvious thing to point out here,…was we didn't need to start referencing interfaces…that we are implementing.…We just define it as a standard function.…So that is definitely something…that's much easier to create.…Let's now go and build the equivalent of this,…apply some function to a string.…And in fact, I think I'm going to copy this,…and then we'll create a new Kotlin file here,…which we'll call Kotlin examples,…and we're going to create that function in here.…
Now I'm going to paste it in,…but not convert it to Kotlin,…just so we've got something we can refer to…and we'll now change this round to be the Kotlin equivalent.…Well, the first thing of course,…is we don't need the key words public and static.…So, we can get rid of those.…This is the return type, so we'll put that at the end,…with a colon before it.…And we'll need the keyword fun in the beginning,…to say this is a function.…And then, our function's taking two parameters,…
Author
Released
1/30/2019- Creating a new Kotlin project
- Working with strings
- Data types in Kotlin
- Creating and calling top-level functions
- Creating classes
- Collections
- Throwing exceptions
- Class inheritance
- Java interoperability
- Functional programming
- Using JUnit with Kotlin
Skill Level Intermediate
Duration
Views
Related Courses
-
Kotlin Essential Training
with David Gassner3h 45m Beginner -
Kotlin for Java Developers
with Troy Miles2h 27m Advanced -
Learning Spring with Spring Boot
with Frank P Moley III1h 33m Intermediate -
Spring: Framework In Depth
with Frank P Moley III2h 16m Intermediate
-
1. Introduction
-
Introduction1m 45s
-
What is Kotlin?5m 46s
-
Installing IntelliJ3m 11s
-
Configuring IntelliJ7m 7s
-
-
2. Working with Strings
-
Variable declaration syntax4m 32s
-
Using string templates4m 40s
-
Multiple line strings6m 54s
-
3. Other Variable Types
-
The Int data type2m 11s
-
Other data types6m 18s
-
Casting in Kotlin6m 35s
-
Chapter review1m 17s
-
4. Nullable Variables
-
The Nothing object type3m 8s
-
5. Functions
-
Single expression functions3m 14s
-
6. Classes
-
Secondary constructors5m 20s
-
Alternative class design5m 3s
-
Functions within a class2m 57s
-
Static functions3m 28s
-
Data classes7m 32s
-
7. Practical Exercise 1
-
Explaining the challenge4m 35s
-
Solution walk-through9m 51s
-
-
8. If and Object Equality
-
The let function9m 36s
-
9. Ranges and Looping
-
The while loop1m 25s
-
Looping with a range6m 13s
-
-
10. Collections
-
Mutable lists1m 30s
-
Maps and sets1m 45s
-
Working with arrays4m 16s
-
11. Practical Exercise 2
-
Explaining the challenge7m 10s
-
Solution walk-through8m 46s
-
-
12. Exceptions and the try-catch Block
-
Exceptions are unchecked4m 55s
-
Throwing exceptions4m 45s
-
try as an expression2m 23s
-
-
13. Testing
-
Using JUnit with Kotlin5m 1s
-
Testing for exceptions4m 20s
-
-
14. Polymorphism and Inheritance
-
Class inheritance5m 11s
-
Creating custom exceptions2m 35s
-
Extension functions4m 38s
-
15. Java Interoperability
-
Using data classes1m 21s
-
Using immutable lists2m 17s
-
Exception handling3m 18s
-
Using static functions2m 13s
-
16. Getting Started with Spring Boot
-
A hello world controller3m 33s
-
Overview of the case study1m 42s
-
Adding services4m 13s
-
Posting to a controller5m 3s
-
Dependency injection6m 38s
-
Revisiting backing beans3m 32s
-
17. Functional Programming
-
filter and flatMap3m 46s
-
reduce and fold6m 33s
-
Working with maps3m 14s
-
18. Getting Started with Hibernate
-
19. Practical Exercise 3
-
Solution walk-through2m 33s
-
Mappings between entities7m 33s
-
Upgrading the view11m 25s
-
Solution walk-through9m 4s
-
Solution walk-through4m 21s
-
20. Reflection
-
The concept of reflection7m 20s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Methods that take function parameters—the Kotlin way