Look at a Kotlin double, and explore the equivalent of the Java instanceOf expression and the .class() method.
- [Instructor] Hello again and welcome to chapter three.…In the last chapter, we looked at strings.…In this chapter, I want us to look at the other…standard data types that we get from Java,…the integer, float, double and so on.…A good starting point to say…is that all of these object types do exist in Kotlin…and you can use them just as you would expect to.…We can declare a double for example like this,…let's say val myDouble equals…and let's give it the number 21.4.…
Just as we saw in the last chapter with strings,…the data type can be inferred.…Now, in Kotlin, there are no little types…so this object will be a type Double with a capital D…rather than double with a lowercase d.…We can check that because in Kotlin,…there is a keyword is which is the equivalent…to Java's instance of.…So I can do something like…printline Is myDouble a Double?…And we let's put the result using the ${ expression,…we can say myDouble is Double.…
So we should get a true if myDouble is an object…of type Double or false otherwise.…Let's just run that and check that we get a true.…
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: Using the Double type and determining class types