Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Introduction to JVM Languages

You're reading from   Introduction to JVM Languages Get familiar with the world of Java, Scala, Clojure, Kotlin, and Groovy

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781787127944
Length 450 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vincent van der Leun Vincent van der Leun
Author Profile Icon Vincent van der Leun
Vincent van der Leun
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Java Virtual Machine FREE CHAPTER 2. Developing on the Java Virtual Machine 3. Java 4. Java Programming 5. Scala 6. Scala Programming 7. Clojure 8. Clojure Programming 9. Kotlin 10. Kotlin Programming 11. Groovy 12. Groovy Programming 13. Other JVM languages 14. Quiz Answers

What this book covers

Chapter 1, Java Virtual Machine, provides a high-level overview of the Java platform and the Java Virtual Machine (JVM). It describes popular use cases for applications running on the JVM, namely web applications, big data analysis, and Internet of Things (IoT). Also covered are important JVM concepts, including its just-in-time compiler, type system, and garbage collector.

Chapter 2, Developing on the Java Virtual Machine, explains the JVM in more technical detail. Covered are both the installation procedure and organization of the Java Development Kit (JDK) on major operating systems (Windows, macOS, and Linux). Also explained is the organization of the Java Class Library and instructions on how to run JVM-based applications by setting up the ClassPath.

Chapter 3, Java, covers the fundamentals of the Java language. It covers creating classes and instantiating objects based on these classes, adding methods and properties to classes, and Java's access modifiers and other modifiers. Some of the other concepts that are discussed include abstract classes, interfaces, arrays, and collections and exceptions. More advanced features such as threading and lambdas are covered as well.

Chapter 4, Java Programming, contains a step-by-step guide to creating a simple web service in the Java language. Tools that are used along the way include the Eclipse IDE, the Gradle build tool, and programming libraries such as SparkJava (a micro web service framework) and the JUnit unit testing framework.

Chapter 5, Scala, talks about the hybrid functional programming and object-oriented programming language Scala. It describes the installation procedure and the usage of the interactive shell bundled with the language. By using the interactive shell, Scala code can be entered and executed dynamically, without explicitly compiling code. Both object-oriented and functional programming in Scala are discussed.

Chapter 6, Scala Programming, contains a step-by-step guide to create a simple console-based application powered by the popular Akka toolkit. Akka is a toolkit specializing in writing scalable applications that take full advantage of modern multicore processors. Many Akka concepts, such as its actor-based system, are discussed thoroughly. To build the project, the Scala Build Tool (SBT) is used, while the ScalaTest library is used for writing unit tests.

Chapter 7, Clojure, explains the fundamentals of Clojure, a dynamic functional programming language inspired by Lisp, which is not object-oriented. Like Scala, Clojure comes with an interactive shell that can be used to enter the various examples that are provided. Agents, a technique to handle state in multithreading applications, are discussed as well.

Chapter 8, Clojure Programming, provides step-by-step guides for two smaller projects. One project is based on monads, a technique that is commonly used in functional programming languages, especially in Lisp. The second project is a web application that is powered by Luminus, a popular micro web framework for Clojure. The Leiningen build tool is used to build both the projects.

Chapter 9, Kotlin, discusses JetBrain's statically typed programming language, Kotlin. Kotlin's type system, which promises null safety, is explained. Other features that are discussed include data classes, lambdas, and inline functions. Procedural programming in Kotlin is covered as well.

Chapter 10, Kotlin Programming, contains a step-by-step guide to create a GUI-based desktop application using the JavaFX toolkit. Apache Maven is used to build the project. The Eclipse IDE's debugger is used to find and fix bugs.

Chapter 11, Groovy, covers the dynamic programming language Groovy, one of the first alternative languages that appeared on the JVM. While Groovy is primarily a dynamic language, it allows compiling statically typed code as well. Both use cases are explained and described in this chapter. Also explored is the Groovy Development Kit, an extensive library of built-in classes, which is distributed as part of the Groovy language distribution.

Chapter 12, Groovy Programming, provides a step-by-step guide to create a web service in Groovy that pulls data from an embedded database management system using the Java Database Connectivity (JDBC) standard and generates XML using classes from the Groovy Development Kit. The Vert.x framework is used to power the web service.

Appendix A, Other JVM Languages, covers five other JVM-based languages, often dialects of mainstream languages: Oracle Nashorn (JavaScript), Jython (Python), JRuby (Ruby), Frege (Haskell), and Ceylon, a statically typed language by Red Hat.

Appendix B, Quiz Answers, gives the solutions to quizes provided at the end of all the chapters.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image