We start out by downloading a JDK and setting up our environment before beginning our journey into Java6. With the environment set up we introduce the code structure of a Java source file and look at syntax. After this we look at the primitive variables available in Java before discussing method scope. We then take an in-depth look at the symbols used for mathematical and logical manipulation that are recognised by the compiler and commonly known as operators. Every computer language has conditional branching and loop structures and Java is no exception. We finish off this section with a look at the conditional and loop statements available in Java6.
In our first lesson on Java6 we download the latest JDK from the Oracle site and setup our environment. We then check that everything is working as it should by running a check to see if the Java compiler can be accessed from the command line.
Now we have the basic environment set up we can take a look at the code structure of a Java source file and look at some syntax. In this lesson we do this and then run our very first Java program.
Java comes with two types of variables to choose from, primitives and reference. In this lesson we look at the various primitive data types that are available in Java.
Symbols used for mathematical and logical manipulation that are recognised by the compiler are commonly known as operators in Java. In the first of two lessons on operators we look at the arithmetic, relational, logical and assignment operators.
In the second lesson on operators we look at the bitwise logical and bitwise shift operators. Bitwise operators perform their operations on the integer types
long and will not work with any other type. These operators are used to manipulate the bits within an integer value, hence the name.
In this lesson we look at the conditional statements available in Java. Conditional statements allow us to evaluate an expression and execute some code dependent upon the outcome. There are two conditional statements we
can use with Java, the
if statement and the
switch statement; the choice of which to use really depends on the
expression being evaluated. There is also the tenary
? : special operator which acts like an
if statement and which we will
cover after looking in detail at the
In this lesson we look at the loop statements available in Java. Loop statements allow us to iterate over some code multiple times. There are two loop statements in Java, the
for statement and the