By Stephen Samuel
Familiarize your self with all of Kotlin's gains with this in-depth guide
About This Book
- Get a radical advent to Kotlin
- Learn to exploit Java code along Kotlin with none hiccups
- Get an entire evaluate of null protection, Generics, and lots of extra attention-grabbing features
Who This ebook Is For
The publication is for latest Java builders who are looking to research extra approximately an alternate JVM language. so as to see what Kotlin has to supply, this booklet is perfect for you.
What you'll Learn
- Use new positive factors to put in writing dependent and readable object-oriented code
- Find out how one can use lambdas and better order features to put in writing fresh, reusable, and easy code
- Write unit assessments and combine Kotlin assessments with Java code in a transitioning code base
- Write real-world construction code in Kotlin within the variety of microservices
- Leverage Kotlin's extensions to the Java collections library
- Use destructuring expressions and tips to write your own
- Write code that avoids null pointer error and notice how Java-nullable code can combine with good points in a Kotlin codebase
- Discover find out how to write features in Kotlin, see the recent good points to be had, and expand latest libraries
- Learn to write down an algebraic info varieties and determine once they might be used
Kotlin has been making waves ever because it was once open sourced via JetBrains in 2011; it's been praised by way of builders the world over and is already being followed by means of businesses. This booklet presents an in depth advent to Kotlin that exhibits you all its positive factors and may provide help to write Kotlin code to production.
We commence with the fundamentals: get you acquainted with operating Kotlin code, establishing, instruments, and directions so you might use to jot down simple courses. subsequent, we conceal item orientated code: features, lambdas, and homes - all whereas utilizing Kotlin's new features.
Then, we circulation directly to null security points and sort parameterization. We enable you destructure expressions or even write your personal. We additionally take you thru vital themes like trying out, concurrency, microservices, and an entire lot extra. through the tip of this publication it is possible for you to to compose assorted companies and construct your personal applications.
Style and approach
An effortless to keep on with advisor that covers the whole set of good points in Kotlin programming.
Read or Download Programming Kotlin PDF
Best java books
Java Programming 24-Hour coach, second variation is your entire beginner's consultant to the Java programming language, with easy-to-follow classes and supplemental workouts that assist you wake up and working quick. step by step guide walks you thru the fundamentals of object-oriented programming, syntax, interfaces, and extra, prior to construction upon your abilities to advance video games, net apps, networks, and automations.
Fast and productively strengthen complicated Spring purposes and microservices - out of the field - with minimum fuss on such things as configurations. This booklet will make it easier to absolutely leverage the Spring Boot productiveness suite of instruments and the way to use them by using case stories. professional Spring Boot is your authoritative hands-on sensible advisor for expanding your Spring Framework-based company Java and cloud program productiveness whereas lowering improvement time utilizing the Spring Boot productiveness suite of instruments.
The Java EE 6 educational complex issues, Fourth version, is a task-oriented, example-driven consultant to constructing company functions for the Java Platform, company variation 6 (Java EE 6). Written via participants of the Java EE 6 documentation group at Oracle, this booklet offers new and intermediate Java programmers with a deep figuring out of the platform.
- XDoclet in action
- Java Database Programming with JDBC: Discover the Essentials for Developing Databases for Internet and Intranet Applications
- JavaFX: Developing Rich Internet Applications
- OSGi and Equinox: Creating Highly Modular Java Systems
Extra resources for Programming Kotlin
For those coming from a Java background, this chapter will highlight some of the key similarities and differences between Kotlin and Java, and how Kotlin's language features compare to those in Java and on the JVM. For those who are not Java programmers, these differences can be safely skipped. In this chapter we will cover the following topics: Variables and values Control flow and expressions Type inference Smart casting Basic types and the Kotlin type hierarchy Vals and vars Kotlin has two keywords for declaring variables, val and var.
If this was a checked exception, literally every function would need to declare it! In Kotlin, since all exceptions are unchecked, they never form part of function signatures. The handling of an exception is identical to Java, with the use of try, catch, and finally blocks. Code that you wish to handle safely can be wrapped in a try block. Zero or more catch blocks can be added to handle different exceptions, and a finally block is always executed regardless of whether an exception was generated or not.
Name}") This is not ready yet. While compiling will go well, trying to execute the JAR will yield an error at runtime about the Student class not being found. The Java compiler needs to know about the Java code sitting under the kotlin folder. basedir}/src/main/kotlin Finally, we are in a position to compile and run the code. jar Summary This chapter has showed you how you can set up your development environment with the tools required to build and run Kotlin code.