Introduction - Wrox Press Java Programming 24-Hour Trainer 2nd (2015)

Wrox Press Java Programming 24-Hour Trainer 2nd (2015)

Introduction

Thank you for considering learning Java with the second edition of my book. This book may look thick, but it’s rather thin given the number of topics covered, and it comes with well-produced and helpful videos.

I like this 24-Hour Trainer series from Wiley Publishing. This is not to say that you can learn the software covered in these books within 24 hours.

It’s about having a trainer that’s with you 24 hours a day. Each book in this series, which is accompanied by a set of videos, contains a minimum of theory to get you started on a subject that is new to you.

This book comes with more than six hours of Java programming screencasts that demonstrate modern concepts, techniques, and technologies in a way that facilitates learning and promotes a better understanding of the development process.

Software developers are often categorized into junior, mid-level, and senior developers. If you master all the materials of this book, rest assured that you will have achieved the technical skills of a mid-level Java developer. I often run technical interviews for the company I work for, and I would be happy if a candidate for a mid-level position could demonstrate an understanding of all the topics covered in this book.

Who This Book Is For

This book is for anyone who wants to learn how to program with the Java language. No previous programming experience is expected.

· This tutorial can be used by Java developers looking for simple working examples that use certain features of the language.

· Accomplished Java developers can also use this book as a refresher while preparing for a technical job interview.

· This tutorial can be used by university students who are interested in learning from a practitioner who has spent 25-plus years developing enterprise software for a living.

· University professors should appreciate the fact that each lesson ends with a Try It section—a prepared assignment for each lesson. Solutions to these assignments are provided as well.

This book is a tutorial, but not in an academic sense. It’s written by a practitioner and is for practitioners.

What This Book Covers

To be called a Java developer, a person has to know not only the core syntax of this programming language, but also the set of server-side technologies called Java EE (Enterprise Edition). This book covers both. At the time of this writing, the latest version of core Java is 8 and the latest release of Java EE is 7. These are the versions covered in this book.

Java is a general-purpose language—you can program applications that run independently on the user’s computer, and applications that connect to remote servers. You can program applications that run exclusively on the server. You can use Java for writing applications for mobile phones and programming games. We live in the Internet of Things (IoT) era, and Java can be embedded into sensors inside cars or in household appliances.

The bulk of this book covers Java programming syntax and techniques that can be used on both users’ computers and the servers. Nine lessons are dedicated to Java EE technologies used for Java programs that run on servers. The final lesson is dedicated to the process of getting prepared for Java technical job interviews for those who are interested in applying for a job as a Java software developer.

How This Book Is Structured

This book is a tutorial. Each lesson walks you through how to use certain elements and techniques of the Java language or gives an introduction to the server-side Java EE technologies. The Try It sections serve as continuations of materials explained in the lessons. The screencasts that come with the book usually illustrate how to complete the assignments from Try It sections.

You can choose to read the lesson and then try to run the examples and work on the lesson assignment, or you can read the lesson, watch the video, and then try to do the assignment on your own.

The lessons are short and to the point. The goal is to explain the material quickly so you can start applying it hands-on as soon as possible. Some readers may feel that more explanation of certain subjects are required; you are encouraged to do some extra research. There are lots and lots of online materials available on any Java-related subject, but the coverage of the material given in this book definitely helps in understanding what to focus on and what to look for.

What You Need to Use This Book

To run the examples and complete the assignments from this book, you do not need to purchase any software—freely available software is used here. Installing Java Development Kit and Eclipse Integrated Development Environment (IDE) is explained in the first two lessons, and this is all you need to get started. In Lesson 21 you download an open source database management system called Derby DB. In Lesson 25 you install Java Application Server GlassFish, which is used for explanation of the Java EE (server-side) technologies covered in Lesson 25 through Lesson 33. Finally, in Lesson 36 you install Gradle—the modern build-automation tool used by professional Java developers. Whenever you need to download certain software, detailed instructions are given in the book and/or in the screencasts.

From the hardware perspective, you can use either a PC running Windows or one of the Apple computers running Mac OS X. Linux fans are also able to run all book samples. You should have at least 2GB of RAM on your computer to run all code examples from this book, but adding more memory can make your Java compiler and Eclipse IDE work faster.

How To Read This Book

This book is a tutorial, and I assume in each lesson that you are already familiar with the materials from the lessons that came before it. If you are new to Java, I highly recommend that you read this book sequentially. Typically, I give you just a little theory, followed by the working code that you can either read or use for trying the concept in a hands-on mode.

Each lesson except the last one has a corresponding video screencast that shows you how to work on the assignment from the Try It section of the lesson, run code samples, or simply install and configure some software. Ideally, you should try to do all the assignments from the Try It sections on your own and use the videos only if you get stuck or don’t understand the instructions. But if you prefer to learn by following the instructor, just watch the video first and then try to repeat the same actions on your own. Whatever works is fine.

Java is a multiplatform language, and programs written for Microsoft Windows, say, should work the same way in Mac OS X or on Linux computers. I’m using a Mac, but I also have special software that enables me to run Microsoft Windows. In this book I use the open-source Eclipse Integrated Development Environment, which exists on all major platforms and looks pretty much the same on each. So regardless of your preferred operating system, you’ll be able to run all the code samples from this book.

Conventions

To help you get the most from the text and keep track of what’s happening, I’ve used a number of conventions throughout the book.

NOTE Notes, tips, hints, tricks, and asides to the current discussion are offset and placed in italic like this.

TIP References like this one point you to the URL to watch the instructional video that accompanies a given lesson.

As for styles in the text:

· We highlight new terms and important words when we introduce them.

· We show filenames, URLs, and code within the text like so: persistence.properties.

· We present code like the following:

We use a monofont type with no highlighting for most code examples.

Source Code

As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All of the source code used in this book is available for download on the book’s page at www.wrox.com.

When you’re at the site, simply click the Download Code link on the book’s detail page to obtain all the source code for the book.

After you download the code, just decompress it with your favorite compression tool. Alternatively, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

Errata

Wiley Publishing and Wrox make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, like a spelling mistake or faulty piece of code, we would be very grateful for your feedback. By sending in errata you may save another reader hours of frustration, and at the same time you will be helping us provide even higher quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list including links to each book’s errata is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don’t spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We’ll check the information and, if appropriate, post a message to the book’s errata page and fix the problem in subsequent editions of the book.

P2P.Wrox.Com

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a web-based system for you to post messages relating to Wrox books and related technologies and interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At p2p.wrox.com you will find a number of different forums that will help you not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

1. Go to p2p.wrox.com and click the Register link.

2. Read the terms of use and click Agree.

3. Complete the required information to join as well as any optional information you wish to provide and click Submit.

4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

TIP You can read messages in the forums without joining P2P but in order to post your own messages, you must join.

After you join, you can post new messages and respond to messages other users post. You can read messages at any time on the web. If you would like to have new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.