Beginning Java6Homepage  « Learn Java6 « Beginning Java6

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.

Getting Started

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.

Code Structure & Syntax

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.

Primitive Variables

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.

Method Scope

You may be familiar with terminology such as global variables and local variables from languages such as JavaScript but this isn't the most accurate way to describe variables and their scope in Java. In fact Java comes with three kinds of variables and we name variables according to the scope they reside in. This lesson is all about local variables and method scope.

Operators

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.

Bitwise 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 byte, short, int and long and will not work with any other type. These operators are used to manipulate the bits within an integer value, hence the name.

Conditional Statements

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 if statement.

Loop Statements

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 while statement.

<<  Learn Java6                    Getting Started  >>

go to home page Java6 Tutor Homepage go to top of page Top