My Account Log in

2 options

Introduction to JVM languages : Java, Scala, Clojure, Kotlin, and Groovy / Vincent van der Leun.

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Leun, Vincent van der, author.
Language:
English
Subjects (All):
Java (Computer program language).
Object-oriented programming (Computer science).
Computer software--Development.
Computer software.
Physical Description:
1 online resource (438 pages) : illustrations
Edition:
1st edition
Place of Publication:
Birmingham, [England] : Packt Publishing, 2017.
System Details:
text file
Summary:
Explore the Java Virtual Machine with modern programming languages About This Book This guide provides in-depth coverage of the Java Virtual Machine and its features Filled with practical examples, this book will help you understand the core concepts of Java, Scala, Clojure, Kotlin, and Groovy Work with various programming paradigms and gain knowledge about imperative, object-oriented and functional programming Who This Book Is For This book is meant for programmers who are interested in the Java Virtual Machine (JVM) and want to learn more about the most popular programming languages that can be used for JVM development. Basic practical knowledge of a modern programming language that supports object-oriented programming (JavaScript, Python, C#, VB.NET, and C++) is assumed. What You Will Learn Gain practical information about the Java Virtual Machine Understand the popular JVM languages and the Java Class Library Get to know about various programming paradigms such as imperative, object-oriented, and functional Work with common JVM tools such as Eclipse IDE, Gradle, and Maven Explore frameworks such as SparkJava, Vert.x, Akka and JavaFX Boost your knowledge about dialects of other well-known programming languages that run on the JVM, including JavaScript, Python, and Ruby In Detail 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...
Contents:
Intro
Cover
Copyright
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Table of Contents
Preface
Chapter 1: Java Virtual Machine
JVM implementations
Why develop on JVM?
JVM adapts to market changes
Java Class Library
Ecosystem
Scenario 1 - Using a JVM application server
Scenario 2 - Using a general high-level web application framework
Scenario 3 - Using a microservice framework
Popular use cases
Web applications
Big data
IoT
JVM concepts
Virtual machine
The JIT compiler
Primitive datatypes
Classes
Reference types
References and null references
Garbage collector
Example
Backward compatibility
Build tools
Java editions
Java SE
Java EE
Example - Java Persistence API as implemented by two application servers
Java ME
Other languages on JVM
Why choose a language other than Java?
Java is a very verbose language
Java is not ideal for everything or everyone
Missing classes in Java Class Library
Mixing JVM languages in a project
Increasing build process complexity
Language runtime libraries
Writing unit tests in a different language
Summary
Chapter 2: Developing on the Java Virtual Machine
JDK
Installing JDK
Downloading JDK
Installing JDK on Windows
Installing JDK on macOS
Installing JDK on Linux
Downloading API documentation
Exploring JDK
The directory structure
JDK commands
GUI monitoring tools
Java VisualVM
Oracle Mission Control
JConsole
JRE
Class organization with packages
What are packages?
Choosing a package name
Package name examples
Fully qualified class name
Java Class Library organization
Package overview
Fundamental classes of the java.lang package.
The Object class (java.lang.Object)
Important object methods
The String class (java.lang.String)
Primitive wrapper classes (Integer, Long, Short, Char, Float, Double in java.lang)
Autoboxing examples
Exceptions and errors (java.lang.Exception and java.lang.Error)
The Collections API - java.util.ArrayList and java.util.HashMap
ArrayList (java.util.ArrayList)
Commonly used methods of the ArrayList class
ArrayList usage example
HashMap (java.util.HashMap)
Commonly used methods of the HashMap class
HashMap usage example
Preparing your classes for the Collections API
About hashCode()
About equals ()
The hashing mechanism
Running JVM applications on the command line
At least one class must have a static main() method
Required directory structure for class files
Setting ClassPath for a JVM instance
Placing class files inside a JAR archive
Runnable JAR file
Running a program with the java command
Run a project consisting of separate class files
Running a project that is placed inside a runnable JAR file
Other useful parameters of the java command
-D to pass properties and values
-ea to enable assertions
A hands-on example project to run on JVM
A ClassPath example
Eclipse IDE
Downloading Eclipse IDE
Installing Eclipse IDE
Chapter 3: Java
OOP in Java
Defining classes
Class access modifiers
Final class modifier - locking a class
Defining packages
Importing classes
Adding class members - variables and methods
Instance variables
Methods
Modifiers
Protecting class members with access modifiers
Access modifier example
Static modifier - instance variables and class variables
Final modifier - locking a class member
Overloading methods
Constructors and finalizers
Constructors
Finalizers.
Extending a class
Overriding methods
Calling constructors of a parent class
Abstract classes
Interfaces
Upcasting and downcasting
Writing Java code
Operators
Conditional checks
The if...else statement
The switch...case statement
POJO
Arrays
Generics and Collections
Loops
The for loop
The normal for loop
The enhanced for loop
The while loop
The do...while loop
Exceptions
Runtime exceptions
Threads
Lambdas
Style guide
Quiz
Chapter 4: Java Programming
Configuring Eclipse IDE
Creating a web service in Java
Creating a new Gradle project in Eclipse IDE
Exploring the generated project
Modifying the Gradle build file
Building the project
Coding the backend class
Backend class business rules
Creating a dummy implementation of the method
Creating the test case class and writing its first unit test
Implementing an input validation check
Writing the second unit test
Implementing the business logic
Creating an executable application task
Creating a web service
Running the web service
Creating Javadoc documentation
Chapter 5: Scala
Installing Scala
Scala's Read-Eval-Print-Loop shell
Functional versus imperative programming
Scala language syntax and rules
Statically typed language
Mutable and immutable variables
Common Scala types
Any class
AnyRef class - reference classes
AnyVal class - value classes
Strings
OOP in Scala
Defining packages and subpackages
Importing members
Instance variables and methods
Instance methods
Access modifiers for class instance members
Extending a class
Traits
Singleton objects
Operator overloading.
Case classes
Scala's standard library
Generics
Collections
Immutable list
Mutable list
Immutable map
Mutable map
XML processing
Functional programming in Scala
Iterating through collections using functions
The map, filter, and reduce design pattern
Map - transform data
Filter - filter items from a collection or array
Reduce - for performing calculations
Currying
Chapter 6: Scala Programming
Scala IDE for the Eclipse plugin
Installing Scala IDE for Eclipse
Switching to the Scala IDE perspective
SBT
Installing SBT
Creating an SBT-based Eclipse IDE project
Creating a new SBT project
Loading the SBTEclipse plugin
Generating a new Eclipse IDE project with SBTEclipse
Importing the generated project in Eclipse IDE
The Scala compiler (scalac)
Creating a singleton object with the main() method
Creating a singleton object that extends the App trait
Creating an Akka project
Adding an Akka dependency to the SBT build file
Updating the Scala IDE project
Akka concepts
Actors
Actor references (ActorRef)
Messages
Dispatchers
Creating our first Akka actor - QuotesHandlerActor
Creating messages
Writing a ScalaTest-based unit test
Implementing a message handler
Creating QuotePrinterActor
The main application
Chapter 7: Clojure
Installing Clojure
Creating a start script
Creating a start script on Windows
Creating a start script on macOS and Linux
Clojure's interactive shell (REPL)
Clojure language
Syntax
Expressions
Defining variables
Defining functions
Data structures
Numeric types
Strings and characters
Lists
Vectors
Sets
Hash-maps
Iteration over arrays and loops
Conditions
Working with Java classes.
Creating simple Java classes with deftype and defrecord
Managing states with agents
Agent example
Chapter 8: Clojure Programming
The Counterclockwise plugin for Eclipse IDE
Installing the Counterclockwise plugin
Switching to the Java perspective
Leiningen's build tool
Installing Leiningen
Creating executable programs in Clojure
Compiling to class files without Leiningen
Compiling projects with Leiningen
Creating a new Counterclockwise project
Clojure REPL in Eclipse IDE
Updating the project's Clojure version
Adding a dependency
Exploring monads by applying test-driven development
The Luminus web framework
Creating a Luminus project
Importing the project in Counterclockwise
Exploring the Luminus project
Adding a page to the web application
Chapter 9: Kotlin
Installing Kotlin
Launch scripts
Kotlin's REPL interactive shell
Kotlin language fundamentals
Defining local variables
Defining a function
Kotlin's types
Kotlin basic types
Null safety handling
Option 1 - Adding a conditional check
Option 2 - Using the safe call operator ?.
Option 3 - Using the Elvis operator ?:
Option 4 - Using the !! operator
Conversions
Collections and generics
OOP in Kotlin
Defining classes and constructors
Adding members to classes
Adding functions
The main entry function
Adding properties
Inheritance
Visibility modifiers
Singleton and companion objects
Data classes
Lambdas and inline functions
Procedural programming in Kotlin
Chapter 10: Kotlin Programming
Kotlin for the Eclipse IDE plugin
Installing the Kotlin plugin for the Eclipse IDE.
Switching to Kotlin perspective.
Notes:
Includes index.
Description based on online resource; title from PDF title page (ebrary, viewed July 25, 2017).
ISBN:
9781787126589
1787126587
OCLC:
994027843

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account