Introduction - Java Programming Box Set: Programming, Master's Handbook & Artificial Intelligence Made Easy; Code, Data Science, Automation, problem solving, Data Structures & Algorithms, 1st Edition (2015)

Java Programming Box Set: Programming, Master's Handbook & Artificial Intelligence Made Easy; Code, Data Science, Automation, problem solving, Data Structures & Algorithms, 1st Edition (2015)


========================= ======

Welcome to the Path of Mastery

We thank you for purchasing & downloading our work, the Master’s Handbook. By doing so, we can tell you have a curiosity to learn Programming in a deeper, more comprehensive way.

We notice that you don’t just want to learn a few tricks here and there, but you want the confidence to take on any programming challenge with ease.

Hence, you’ve come to the right place…

The Master’s Circle

You aren’t alone.

Behind this book are programmers hailing from some of the most Best Computer Science Programs taught by some of the most Advanced Universities in the World Today.


There are two major things that you need to do in order to be a good programmer. One is to get a good amount of practice. The other is to get a really good education.

But how can you tell what source of education is good or not?

You see, we can tell you that 90% of programming learning sources out there will show you WHAT the code is and HOW it works, for any amount of Programming languages. But that’s not necessarily a bad thing - and plenty of those sources are really good too.

However, they might not teach you WHY or WHEN you would use any particular code. NOR would they show you WHAT ELSE you might need with that code.

If you needed to program something, you don’t want to be someone that knows a bunch of code but does not know how to use them, right?

As you read on, you’ll quickly learn not just the HOW and WHAT the code is, but the WHERE, WHEN, WHY to use it, WHAT ELSE you’ll need with it- and more importantly, HOW to really use it.

The Master Structure

We start by observing the world and defining the code to represent things (data) or actions (functions). As you progress through the book, you’ll find more advanced concepts and ways to combine them all together.

You’re also accommodated with the Main Programming Language this book comes with, as well as general PseudoCode to help understand coding concepts. Often times, you’ll find that our PseudoCode bridges

you from learning this Book’s Main Language to learning your Next Language!

Whether you haven’t coded a single line before, or you’ve already build serious projects, you WILL find great value in this book. Often times, you’ll run into a coding challenge in your programming journey. This book will help you identify how to progress through it!

========================= ======

Editor’s Note

========================= ======


If you ever wonder why Computer Scientists make so much money (including junior programmers, developers, software engineers, IT folks, and just about any job involving programming), there are plenty of good reasons.

One, is that in today’s world, just about EVERY industry out there requires a level of technological sophistication. So you can imagine the level of demand for hiring a qualified programmer.

But the truth about Computer Science is that it can be very intellectually challenging most of the time. Thus, only a certain number of people will be good enough to get a real career in programming.

So there you have it. High Demand + Few Good Programmers = GOOD Salary.

However, you may not need a university degree to be a good programmer…


The true point of this book, along with others in this series, is to go deeper than the lines of code you see. You’ll learn how to use every bit of data and code to any situation you encounter - and at one point, intuitively.

A real programmer’s job is to create tools that improve life in one way or another. Almost all of the time, it will involve having to come up with ways to represent things in life as data - as well as getting a computer to process the data properly and turn into something useful.

So if you want to become a better programmer, read on…

JAVA Introduction

========================= ======

JAVA: Universal Remote Control

Java is one of the most widely used, popular programming languages in the world today. And it’s not difficult to see why. Endless apps across many platforms - including Windows, Linux, Android & Windows phones, and even servers - are powered by Java code. In most schools and colleges that teach programming, Java is often the first language taught. With many Java programmers available, massive app projects can be crafted more easily.

However, the Java language does have its challenges. Many programmers may find Java’s syntax strict and inflexible. Also, programmers may find that Java is quite verbose. For the exact same program functionality, Java often requires more code written than other languages. Furthermore, programmers need to be careful with Java app memory usage - as Java-based apps often use more memory to run.

Nevertheless, learning to code in Java can be very rewarding - in terms of skill and salary.

JAVA Advantages:

-universal; popular

-massive array of java libraries & API’s

-code runs on many platforms

JAVA Disadvantages:

-inflexible, complex


-higher memory usage

JAVA Workshops:

These workshops are yours to complete in whichever way you like (However, the code MUST work!).

They’re designed to put the most recent concepts into real-life practice, yet giving you the flexibility and critical thinking along the way.

And of course, flexibility and deep critical thinking are key programmer traits!

Find them throughout the book!

========================= ======

JAVA-00: Quick Important notes about Java code

A Java Class File

Classes will be explained more in detail later in JAVA-02. But for now, start your Java code with these next few lines of code:

// —————————————

import java.util.*;

import java.lang.*;


class ___{

public static void main(String args[]) {




// —————————————

By default, online compilers will have a similar code structure to the above. For now, just make sure you ONLY add code within the brackets by ‘public static void main’ (where the comments tell you to)

Also, make sure all three import lines above are in your code. Plenty of Java functionality is from these Java libraries.


if you use an online compiler we mentioned, fill in the blank line beside class into one of the below, depending on which site you’ve used:

Rextester ( fill with ‘Rextester’

CodeChef ( fill with ‘Codechef’

Codepad: (doesn’t support Java)

Ideone ( fill with ‘Ideone’

Prelude: Atomic Data Types

First off, we’ll briefly start with primitive data types. It’s important to know what they are, because you’ll be identifying real-life information with them later.


Booleans, often called bools, are either TRUE or FALSE. This is the simplest data type, but often one of the most important. A LOT of functionality depends on Booleans, as you will find out later

A Boolean will always be a two-state situation. For example, the lights in your living room are either on (TRUE) or off (FALSE).


These are all the standard whole numbers, both positive and negative. Higher and lower (negative) integers depend on the number of bits to represent them (i.e. 8-bit integers, 16-bit, etc.). Mathematic and boolean operators often use Integers.

For example:

10 + 50 == 60,

-4 - 12, != -10,

and so on.


These are all letters and symbols that can be represented by ASCII characters. Think of one character as a single symbol or letter, such as upper or lower case letters, symbols (!,@,#,$ and so on), and even numbers. However, take note: you cannot do any arithmetic with number characters. (i.e. if you have characters 12 and 9, you can’t add them, subtract, and so on.)


Formally called floating-point numbers, these represent decimals - including the decimal point and decimal numbers beyond.




Prelude: Data Sequences & Combinations


These are merely a collection of Characters in sequence. Think of these as words or phrases.

In most programming languages, Strings are represented by a sequence of characters between quotation marks: “Hi there”, or “Hello.”, for example.

How these would look like as a sequence of characters is as follows:

“Hi There” is represented as characters H,i, space, T, h,e , r, and e

“Hello.” is represented as characters H, e, l, l, o, and the period.


These are a sequence of individual elements put together as a list. Often times, all the elements within that list are the same data type

Examples would be:

a List of Integers: [3, 1, 4, 9, 2]

a List of Strings: [“Apple”, “Banana”, “Caramel”]

a List of Booleans: [true, false, true, true]


These are fixed sets of data values. The data within these sets are the same data type. You would have to choose between one of the data elements within that set.

For example, traffic lights are either red, orange, or green.

As an enumeration, traffic lights would be: [“Red, “Green”, “Yellow”]

What differs Enumerations from lists is that Enumerations are supposed to have a FIXED set of values. You wont be able to add or delete the elements unless you edit the code directly.


Itemizations combine different data types together to form a finite set. Depending on the data type of a single element, you’ll have to process that data in a certain way (you’ll learn about this later in function templates).

Enumerations have the same data type, but Itemizations have different data types in the set. You also won’t be able to add or delete any of the elements as well.

For example, a Space Rocket launch would be a set of integers 10 to 1, then the booleans true or false, to signifiy whether or not it has launched yet.

As an itemization, a Space Rocket Launch would be: [ false, 10, 9, … 1, true]

Prelude: Your Coding Environment

Simple Online IDE

For now, it’s all about understanding all the Programming Concepts, from the simple to the downright advanced.

To test out these concepts, you’ll only need a simple online Compiler to run your code and make sure it works the way you planned it to.

Here’s a few ones online. They’re FREE and they don’t require any membership to test out your code:

Full Development Kits

You may also set up your computer for app development, if you wish.

First, identify what Programming Language(s) and Framework(s) you wish to use. Then choose and set up the ideal Integrated Development Environment (IDE) for your language-framework combinations.

Popular IDE’s include IntelliJ, Eclipse, Netbeans, CodeLite, XCode (for Mac Users) and more. But remember: make sure your IDE supports the programming languages of your choice.

NOTE: Comments

For newcomers just learning how to program, it’s important to describe what your lines of code are and why they exist in your code.

For programming teams, comments are essential. Even seasoned programmers who work in teams need to explain what their code does and why they have it. Also, programming teams find that they save time analyzing and figuring out other people’s code. They will also have less errors along the way - knowing that they’re coding what they mean to code, or editing code to be the way they originally want it to be.