Book Image

Introduction to Programming

By : Nick Samoylov
Book Image

Introduction to Programming

By: Nick Samoylov

Overview of this book

Have you ever thought about making your computer do what you want it to do? Do you want to learn to program, but just don't know where to start? Instead of guiding you in the right direction, have other learning resources got you confused with over-explanations? Don't worry. Look no further. Introduction to Programming is here to help. Written by an industry expert who understands the challenges faced by those from a non-programming background, this book takes a gentle, hand-holding approach to introducing you to the world of programming. Beginning with an introduction to what programming is, you'll go on to learn about languages, their syntax, and development environments. With plenty of examples for you to code alongside reading, the book's practical approach will help you to grasp everything it has to offer. More importantly, you'll understand several aspects of application development. As a result, you'll have your very own application running by the end of the book. To help you comprehensively understand Java programming, there are exercises at the end of each chapter to keep things interesting and encourage you to add your own personal touch to the code and, ultimately, your application.
Table of Contents (21 chapters)

What this book covers

Chapter 1, Java Virtual Machine (JVM) on Your Computer, introduces Java as a language and as a tool. It describes the motivation for Java creation, its history, its editions, architectural principles, and components. It also outlines the Java marketing position and the main areas of application. Then, a sequence of practical steps walk you through the process of Java machine installation and configuration on your computers and through its usage and main commands.

Chapter 2, Java Language Basics, introduces the basic concepts of Java as an Object Oriented Programming (OOP) language. You will learn about classes, interfaces, objects, and their relations, along with OOP concepts and features.

Chapter 3, Your Development Environment Setup, explains what development environment is and guides you through its configuration and tuning. It also has an overview of popular editors and build frameworks. The step-by-step instructions help the reader to create their own development environment, and configure it, including the setting of a classpath and using it in practice.

Chapter 4, Your First Java Project, uses everything that was learned so far and guides the reader through the process of writing a program and developer’s test and running them.

Chapter 5, Java Language Elements and Types, familiarizes the reader with Java language elements: identifiers, variables, literals, keywords, separators, comments, and similar ones. It also describes types—both primitive and reference. Special attention is applied to class String, enum types, and arrays.

Chapter 6, Interfaces, Classes and Objects Construction, explains the most important aspects of Java programming—Application Programming Interface (API), object factories, method overriding, hiding, and overloading. The usage of keywords this and super is also introduced here. The chapter concludes with the discussion of final classes and methods.

Chapter 7, Packages and Accessibility (Visibility), introduces the notion of a package and teaches the reader how to create and use it for better code clarity. It also describes different levels of accessibility (visibility) of classes and class members—methods and properties. It concludes with the discussion of the key OOP design concept of an encapsulation.

Chapter 8, Object-Oriented Design (OOD) Principles, presents a higher-level view on Java programming. It discusses the criteria of a good design and provides a guide to the well-proven OOD principles. It also demonstrates code examples that illustrate the discussed principles.

Chapter 9, Operators, Expressions, and Statements, helps you dive deeper into three core elements of Java programming: operators, expressions, and statements. You will see the list of all Java operators, learn details about the most popular ones, and be able to execute specific examples that illustrate the key aspects of each of them.

Chapter 10, Control Flow Statements, describes Java statements that allow building a program flow according to the logic of the implemented algorithm, including conditional statements, iterative statements, branching statements, and exceptions.

Chapter 11, JVM Processes and Garbage Collection, allows the reader to look under the hood of JVM and see that it is more complex than just program runner. It executes several service threads in addition to the application threads. One of the service threads executes an important mission of releasing the memory from unused objects.

Chapter 12, Java Standard and External Libraries, provides an overview of the most popular libraries included with JDK and the external ones. Brief examples demonstrate the library capabilities. The chapter also guides users how to find a library on the internet.

Chapter 13, Java Collections, introduces you to Java collections with code examples that demonstrate their usage.

Chapter 14, Managing Collections and Arrays, introduces you to classes that allow you to create, initialize, and modify collections and arrays. They also allow the creation of unmodifiable and immutable collections. Some of these classes belong to Java standard libraries, others to popular Apache Commons libraries.

Chapter 15, Managing Objects, Strings, Time, and Random Numbers, demonstrates classes and utilities from Java Standard Library and Apache Commons that every programmer has to master in order to become an effective coder.

Chapter 16, Database Programming, explains how to write Java code that can manipulate—insert, read, update, and delete—data in a database. It also provides a short introduction to SQL language and basic database operations.

Chapter 17, Lambda Expressions and Functional Programming, explains the concept of a functional programming. It provides an overview of functional interfaces that come with JDK and explains how to use them in lambda expressions.

Chapter 18, Streams and Pipelines, introduces the reader to the powerful concept of data stream processing. It explains what streams are, how to process them using lambda expressions, and how to build processing pipelines. It also shows how easily you can organize stream processing in parallel.

Chapter 19, Reactive Systems, provides an overview and the prospects for your future professional work. As more data gets processed and services become more sophisticated, the need for more adaptive, highly scalable, and distributed processes grows exponentially, and this is what we will address in this chapter—how such a software system looks in practice.