Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Head First Kotlin: What are the differences in terms of common frameworks?

Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A question about the common frameworks in Java & Kotlin.

What are the differences of Kotlin's lambdas, collections, generics to the Java counterparts?
There are such differences apart from syntax?

Posts: 105
Android Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jorge,

You will find that all of the stuff you can do in Java, you can do in Kotlin. But there are a whole bunch of new things that are available in Kotlin. Initially, a lot of Kotlin really relied upon the structures in Java. That's easy to do, because Kotlin on the JVM can run anything that Java can. So all of the collection types could be used, because you just needed to import things from java.util. But this limited the code that could be recompiled to other platforms (such as JavaScript), so over time the Kotlin developers have been creating more Kotlin-y ways of doing stuff. So in the Kotlin standard library you will find things like "Comparable" that will seem strangely familiar. In this way, Kotlin is steadily building its own platform-independent stack that will allow you to (for example) more easily port your Java libraries into modules that could be used in the client Java application.

Also, Kotlin has some much more advanced features that are easily done in Java. They have co-variant and contra-variant generics. Co-routines. It can use the more modern idioms that JavaScript developers have had available for years. If you start to learn Kotlin, you will find a *lot* that is very familiar. But you will also find some wonderful new tools that will allow you to create more flexible and solid code.

Thanks for the question.

Crusading Chameleon likes the size of this ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!