Learn Java 12 Programming
eBook - ePub

Learn Java 12 Programming

A step-by-step guide to learning essential concepts in Java SE 10, 11, and 12

Nick Samoylov

Share book
  1. 690 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learn Java 12 Programming

A step-by-step guide to learning essential concepts in Java SE 10, 11, and 12

Nick Samoylov

Book details
Book preview
Table of contents
Citations

About This Book

A comprehensive guide to get started with Java and gain insights into major concepts such as object-oriented, functional, and reactive programming

Key Features

  • Strengthen your knowledge of important programming concepts and the latest features in Java
  • Explore core programming topics including GUI programming, concurrency, and error handling
  • Learn the idioms and best practices for writing high-quality Java code

Book Description

Java is one of the preferred languages among developers, used in everything right from smartphones, and game consoles to even supercomputers, and its new features simply add to the richness of the language. This book on Java programming begins by helping you learn how to install the Java Development Kit. You will then focus on understanding object-oriented programming (OOP), with exclusive insights into concepts like abstraction, encapsulation, inheritance, and polymorphism, which will help you when programming for real-world apps. Next, you'll cover fundamental programming structures of Java such as data structures and algorithms that will serve as the building blocks for your apps. You will also delve into core programming topics that will assist you with error handling, debugging, and testing your apps. As you progress, you'll move on to advanced topics such as Java libraries, database management, and network programming, which will hone your skills in building professional-grade apps.

Further on, you'll understand how to create a graphic user interface using JavaFX and learn to build scalable apps by taking advantage of reactive and functional programming.

By the end of this book, you'll not only be well versed with Java 10, 11, and 12, but also gain a perspective into the future of this language and software development in general.

What you will learn

  • Learn and apply object-oriented principles
  • Gain insights into data structures and understand how they are used in Java
  • Explore multithreaded, asynchronous, functional, and reactive programming
  • Add a user-friendly graphic interface to your application
  • Find out what streams are and how they can help in data processing
  • Discover the importance of microservices and use them to make your apps robust and scalable
  • Explore Java design patterns and best practices to solve everyday problems
  • Learn techniques and idioms for writing high-quality Java code

Who this book is for

Students, software developers, or anyone looking to learn new skills or even a language will find this book useful. Although this book is for beginners, professional programmers can benefit from it too. Previous knowledge of Java or any programming language is not required.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learn Java 12 Programming an online PDF/ePUB?
Yes, you can access Learn Java 12 Programming by Nick Samoylov in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Science General. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781789958485
Edition
1

Section 1: Overview of Java Programming

The first part of the book brings the reader into the world of Java programming. It starts with basic Java-related definitions and the main terms, walks the reader through the installation of the necessary tools and Java itself, and explains how to run (execute) a Java program and the examples of the code provided with this book.
With the basics in place, we then explain and discuss Object-Oriented Programming (OOP) principles, how Java implements them, and how a programmer can take advantage of them to write high-quality code that is easy to maintain.
The book proceeds by presenting a more detailed view of Java as a language. It explains how the code is organized in packages, defines all the main types, and the list of reserved and restricted keywords. All the discussions are illustrated with specific code examples.
This section contains the following chapters:
Chapter 1, Getting Started with Java 12
Chapter 2, Java Object-Oriented Programming (OOP)
Chapter 3, Java Fundamentals

Getting Started with Java 12

This chapter is about how to start learning Java 12 and Java in general. We will begin with the basics, first explaining what Java is and its main terms, followed by how to install the necessary tools to write and run (execute) a program. In this respect, Java 12 is not much different to the previous Java versions, so this chapter's content is applies to the older versions too.
We will describe and demonstrate all the necessary steps for building and configuring a Java programming environment. This is the bare minimum that you have to have on the computer in order to start programming. We also describe the basic Java language constructs and illustrate them with examples that can be executed immediately.
The best way to learn a programming language, or any language for that matter, is to use it, and this chapter guides the reader on how they can do this with Java. The topics covered in this chapter include the following:
  • How to install and run Java
  • How to install and run an Integrated Development Environment (IDE)
  • Java primitive types and operators
  • String types and literals
  • Identifiers and variables
  • Java statements

How to install and run Java

When somebody says "Java," they may mean quite different things:
  • Java programming language: A high-level programming language that allows an intent (a program) to be expressed in a human-readable format that can be translated in the binary code executable by a computer
  • Java compiler: A program that can read a text written in the Java programming language and translate it into a bytecode that can be interpreted by Java Virtual Machine (JVM) in the binary code executable by a computer
  • Java Virtual Machine (JVM): A program that reads a compiled Java program and interprets it into the binary code that is executable by a computer
  • Java Development Kit (JDK): The collection of programs (tools and utilities), including Java compiler, JVM, and supporting libraries, which allow the compilation and execution of a program written in the Java language
The following section walks the reader through the installation of the JDK of Java 12 and the basic related terms and commands.

What is JDK and why do we need it?

As we have mentioned already, JDK includes a Java compiler and JVM. The task of the compiler is to read a .java file that contains the text of the program written in Java (called source code) and transform (compile) it into a bytecode stored in a .class file. The JVM can then read the .class file, interpret the bytecode in a binary code, and send it to the operating system for execution. Both the compiler and JVM have to be invoked explicitly from the command line.
To support the .java file compilation and its bytecode execution, JDK installation also includes standard Java libraries called Java Class Library (JCL). If the program uses a third-party library, it has to be present during compilation and execution. It has to be referred from the same command line that invokes the compiler and later when the bytecode is executed by JVM. JCL, on the other hand, does not need to be referred to explicitly. It is assumed that the standard Java libraries reside in the default location of the JDK installation, so the compiler and JVM know where to find them.
If you do not need to compile a Java program and would ...

Table of contents