One of the design goals with Kotlin is interoperability with Java. Learn how to call Java code from Kotlin.
- [Narrator] Interoperability with Java…is a major design goal for Kotlin.…Many teams will have a large amount…of Java code in their repositories.…And there are far more libraries written…in Java than in Kotlin,…so being able to call Java code from Kotlin…isn't just important, it is critical.…Let's begin by creating a Java class.…In the Project window, expand src, main, java,…then right click on java.…Choose New, Java Class.…
We're going to name this class com.tekadept.demo.Animal…with a capital A, and click Return.…And we'll create our Java class.…So we're going to say private, final String name.…Private final String kind.…This is going to say what kind of animal we're creating.…
Private Integer weight, how much our animal weighs.…Create our constructor.…Public Animal String name, String kind, Integer weight.…And we'll say this.name equals name.…This.kind equals kind.…
And this.weight equals weight.…Then we'll start creating our getters.…So we'll say public String getName.…And it returns name.…Public String getKind,…
- Kotlin as a better Java
- Setting up a Kotlin programming environment
- Val vs. var
- Understanding basic Kotlin programming concepts
- Object-oriented programming
- Using Java from Kotlin
- Using Kotlin from Java
- Annotations, reflection, and DSL construction
- Functional programming in Kotlin
Skill Level Advanced
1. Kotlin as a Better Java
Why a new JVM language?1m 35s
2. Get Started with Kotlin
3. Basic Kotlin Programming
4. Object-Oriented Programming
5. Java Interop
6. Advanced Kotlin Features
7. Functional Programming in Kotlin
- 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.Cancel
Take 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.