Skip To Content

Athabasca University

Unit 2: First Program and Program Control

Unit Overview

This unit will help you design, develop, implement, and run a simple Java application using the SDK. You will also describe and use the elements of program control in Java.

Learning Outcomes

After completing this unit, you should be able to

  1. compile and run a simple Java application using the SDK;
  2. list the code conventions for the Java programming language;
  3. write program logic with loops;
  4. use operators to perform calculations and control the program flow.

Learning Activities

  1. Read the Learning Notes and follow the links to read the recommended online materials.
  2. Read the Review Questions and use the discussion board of this course to
    1. answer any two of the review questions;
    2. share any useful information about the supplemental reading materials that you have read;
    3. comment on another student’s response to the review questions;
    4. answer any questions posed to you.
  3. Complete the Unit Exercises and share your experience with your peers on the discussion board. [Note: Do not post assignment-relevant pseudocodes or source codes at any time; however, you may post your thoughts, ideas, and problem-solving steps.]

Learning Notes

Read the following recommended online materials:

  1. The Java Tutorials. (2020). Lesson: The “Hello World!” Application. Redwood Shores, CA: Oracle Corporation.

    Choose the appropriate tutorial for your computing environment (Windows or Linux). Review the checklist to ensure that your JDK is installed and ready.

  2. The Java Tutorials. (2020). Lesson: A Closer Look at the “Hello World!” Application. Redwood Shores, CA: Oracle Corporation.

    Review the code you’ve written for your Java application.

  3. Google Java Style Guide. (2014).

    OR
    Achut, R. (2000). Java™ Coding Style Guide.

  4. Poo, D., Kiong, D., & Ashok, S. (2008). Object-Oriented Programming and Java (2nd ed.). London: Springer-Verlag.
    1. Read Chapter 3: A Quick Tour of Java (pp. 17–37).
    2. Read Chapter 8: Modularity (pp. 103–117).
    3. Read Section 10.3: Basic Input and Output (pp. 138–141).
  5. Eckel, B. (2001). Cleanup: Finalization and Garbage Collection. Thinking in Java (3rd ed.). Upper Saddle River, NJ: Pearson Education.

    This web page belongs to Bruce Eckel’s Thinking in Java. You may also want to click on the Contents link and take a look at Chapter 4: Initialization and Cleanup.

Updated July 30 2020 by FST Course Production Staff