Kotlin is a programming language based on Java Virtual Machine from Jetbrains which creator of the Intellij Idea, PyCharm, Webstorm, etc. Every application we’re gonna write with Kotlin is easily portable to every operating system out there which is also one of the main advantages of Java. If you were scared when you saw complicated Java code (like me) but you want developing Android applications, Kotlin is one of the your alternatives.
I said Kotlin is based on Java and good news, you can use all Java libraries. Also you can integrate Kotlin to any existing Java projects you may have. JetBrains guarantees 100% compatibility. From the Kotlin website:
Interoperable: Leverage existing frameworks and libraries of the JVM with 100% Java Interoperability.
Kotlin codes compiles to JVM bytecode (or you can compile Javascript). Instead of requiring a completely new runtime environment, Kotlin generated Java can re-use all of the existing Java libraries and Kotlin actually improves some of the more annoying sides of Java. I am gonna create new data class in both languages to compare, first in Java;
public class Steemian {
private long id;
private String name;
private String url;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override public String toString() {
...
}
Now in Kotlin;
data class Steemian(
var id: Long,
var name: String,
var url: String)
Can you see the difference? I know. In this series, I’m gonna write simple tutorials about Kotlin Basics. You can see the next topics in syllabus. Thanks for reading.
Syllabus
- What is Kotlin?
- Setup Development Environment 10/01/2017)
- Basic Data Types (10/03/2017)
- Variables (10/05/2017)
- Conditional Statements Part 1 (10/07/2017)
- Conditional Statements Part 2 (10/09/2017)
- Arrays & Lists (10/12/2017)
- for & while Loops (10/15/2017)
- Other Loops (10/17/2017)
- Functions Part 1 (10/19/2017)
- Functions Part 2 (10/21/2017)
- Object Oriented Programming Part 1 (10/23/2017)
- Object Oriented Programming Part 2 (10/27/2017)
- Object Oriented Programming Part 3 (10/31/2017)
- Object Oriented Programming Part 4 (11/04/2017)
This post recieved an upvote from minnowpond. If you would like to recieve upvotes from minnowpond on all your posts, simply FOLLOW @minnowpond
@reggaemuffin got you a $8.65 (4.0%) @minnowbooster upgoat, nice! (Image: pixabay.com)
Want a boost? Click here to read more about @minnowbooster!
The @OriginalWorks bot has determined this post by @scaevola to be original material and upvoted it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!
To enter this post into the daily RESTEEM contest, upvote this comment! The user with the most upvotes on their @OriginalWorks comment will win!
For more information, Click Here!
Special thanks to @reggaemuffin for being a supporter! Vote him as a witness to help make Steemit a better place!