Data Types, Variables, and Arrays

This chapter examines three of Java’s most fundamental elements: data types, variables,and arrays. As with all modern programming languages, Java supports several typesof data. You may use these types to declare variables and to create…

Lexical Issues

Lexical Issues Now that you have seen several short Java programs, it is time to more formally describe the atomic elements of Java. Java programs are a collection of whitespace, identifiers, literals, comments, operators, separators,…

Using Blocks of Code

Using Blocks of Code Java allows two or more statements to be grouped into blocks of code, also called code blocks. This is done by enclosing the statements between opening and closing curly braces. Once…

Two Control Statements

Two Control Statements The if Statement The Java if statement works much like the IF statement in any other language. Further, it is syntactically identical to the if statements in C, C++, and C#. Its…

A Second Short Program

A Second Short Program Perhaps no other concept is more fundamental to a programming language than that of a variable. As you probably know, a variable is a named memory location that may be assigned…

First Simple Program

First Simple Program Now that the basic object-oriented underpinning of Java has been discussed, let’s look at some actual Java programs. Let’s start by compiling and running the short sample program shown here. As you…

An Overview of Java

An Overview of Java: As in all other computer languages, the elements of Java do not exist in isolation. Rather, they work together to form the language as a whole. However, this interrelatedness can make…

A Culture of Innovation

A Culture of Innovation: Since the beginning, Java has been at the center of a culture of innovation. Its original release redefined programming for the Internet. The Java Virtual Machine (JVM) and bytecode changed the…

Java SE 6

Java SE 6: The newest release of Java is called Java SE 6, and the material in this book has been updated to reflect this latest version of Java. With the release of Java SE…

The Evolution of Java

The Evolution of Java: The initial release of Java was nothing short of revolutionary, but it did not mark the end of Java’s era of rapid innovation. Unlike most other software systems that usually settle…