Book Image

Introduction to JVM Languages

Book Image

Introduction to JVM Languages

Overview of this book

Anyone who knows software development knows about the Java Virtual Machine. The Java Virtual Machine is responsible for interpreting Java byte code and translating it into actions. In the beginning, Java was the only programming language used for the JVM. But increasing complexity of the language and the remarkable performance of the JVM created an opening for a new generation of programming languages. If you want to build a strong foundation with the Java Virtual Machine and get started with popular modern programming languages, then this book is for you. The book will begin with a general introduction of the JVM and its features, which are common to the JVM languages, helping you get abreast with its concepts. It will then dive into explaining languages such as Java, Scala, Clojure, Kotlin, and Groovy and will show how to work with each language, their features, use cases, and pros and cons. By writing example projects in those languages and focusing on each language’s strong points, it will help you find the programming language that is most appropriate for your particular needs. By the end of the book, you will have written multiple programs that run on the Java Virtual Machine and know about the differences between the various languages.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Summary


In this chapter, you learned more about Scala, a language that has strong support for functional programming while being a pure OOP language at the same time. We started the chapter by installing Scala and using the scala command, the REPL interactive shell of Scala. You used this powerful program to try all the code snippets in this chapter. We explained the difference between imperative and functional programming. We looked at many OOP features of the Scala language and discovered that many statements are more powerful in Scala than Java's versions of the same statements. We also found out that the access modifiers of Scala and Java are similar to each other but not completely the same. You tried out some collection classes from the Scala standard library and applied generics to them. We concluded this chapter by examining functional programming in more detail.

With all the theory behind us, it's time to realize a small project with Scala. This time we will use the scalac compiler...