O'Reilly logo

Data Structures and the Java Collections Framework, Third Edition by William J. Collins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 0

Introduction to Java

This is a book about programming: specifically, about understanding and using data structures and algorithms. The Java Collections Framework has a considerable number of data structures and algorithms. Subsequent chapters will focus on what the framework is and how to use the framework in your programs. For this information to make sense to you, you will need to be familiar with certain aspects of Java that we present in this chapter. All of the material is needed, either for the framework itself or to enable you to use the framework in your programming projects.

CHAPTER OBJECTIVES

  1. Learn (or review) the fundamentals of Java, including classes, objects and messages.
  2. Be able to use javadoc in writing method specifications.
  3. Incorporate the Scanner class into your programming.
  4. Understand the significance of the fact that a copy of the argument is stored in the corresponding parameter when a method is called.
  5. Understand the details of arrays and output formatting.

0.1 Java Fundamentals

Every Java program is a collection of classes. Basically, a class consists of variables, called fields, together with functions, called methods, that operate on those fields. A program is executed when a special method, the main method, is called by the run-time system (also known as the Java Virtual Machine). The heading of this method is fixed, as shown in the following program:

public class HelloWorld
{
     public static void main (String [ ] args) { System.out.println ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required