Jump to page content Jump to navigation

College Board

AP Central

Print Page
Home > AP Courses and Exams > Course Home Pages > Java as a Pre-AP Strategy in Computer Science

Java as a Pre-AP Strategy in Computer Science

by James Aldridge, Ph.D.
Fort Worth Country Day School
Fort Worth, Texas

Part I

This is the first in a series of articles designed to take a computer science teacher in the Pre-AP years through the more difficult and confusing first components of teaching computer science in Java. We begin with an article discussing and supporting Java as a first language. Additional articles will discuss the logistics of getting the classroom ready, designing the course structure and the role of lectures and labs, integrating student projects in the course, and evaluating student assignments and projects.

Choosing an Implementation Language
The choice of an implementation language for computer science in the Pre-AP years is a hot topic among teachers. Indeed, whether such a course ought to even have a specified implementation language is up for discussion. To move the debate from the ivory tower to the secondary school classroom, I've observed that students as a group are more motivated to investigate program design, algorithms, data structures, and such when they are able to code applications that actually do something interesting.

Among the candidate languages for the Pre-AP years, Scheme, BASIC (including Visual Basic), Pascal, C/C++, Microsoft's .NET languages C# and J#, and Sun's Java might be included. These latter two are noteworthy as their attachment to certain companies gives them a proprietary air. I think this attachment says more about the nature of the relationship between the two companies than it says about any particularly proprietary quality of the languages themselves. Indeed, C#, J#, and Java are all object-based languages that share a C++-like syntax and a determined adherence to object design philosophy. This commonality makes all of them good candidates for a Pre-AP language.

I chose Java for a number of reasons.
  1. The compiler is free.
  2. There are several good, free integrated development environments (IDEs) available (indeed, it's easy to get up and running using only a simple text editor for writing source code; an IDE is optional).
  3. The language is a de facto standard for writing Web-based applications (applets).
  4. In the marketplace, C++ and Java run neck and neck as important languages.
  5. Java is seamlessly available in Linux and Apple versions, an important consideration among my students.
  6. Java is the language used on the AP Computer Science Exams as of 2004.
In addition to these five items, Java, along with several other of the languages mentioned, equips users with a rich supply of graphical user interface (GUI) components. The use of a GUI greatly enhances the language in the eyes of many students even if it is largely beside the point in a consideration of basic computer science ideas. Finally, in specific contradistinction to C++, Java removes a lot of potholes: no pointers, no operator overloading, no multiple parameter passing techniques, and no need to explicitly reclaim (delete) dynamically allocated memory.

Java can be used to implement two distinct categories of programs: applets and applications. Java applets are intended to be loaded as part of a Web page. As such, their functionality is extremely limited by security requirements. After all, do you want Fred R. Hacker's applet to have control over your local file system? Java applications are much like any other computer programs; they generally have full access to your local system resources, and they are very network (LAN or Internet) savvy. My students work mostly with Java applications.

In the line of practical advice to beginning Java teachers, I offer a few suggestions. First, get to know Sun's Java Web site (available below in "See also"). Second, become comfortable with the Java API documentation, available online and for download in HTML format. Third, run through at least the initial parts of Sun's online Java Tutorial.

In Part II of this series, I will describe the practical side of getting a classroom up and running for Java.

Please note: Some topics covered in this series of articles are not included in the defined curriculum. Refer to the current official AP CS Course Description for the topics that will be tested on the AP Exams.

James Aldridge, Ph.D., is a science and computer science teacher at Fort Worth Country Day School in Fort Worth, Texas. He has taught computer programming for 10 years and currently teaches AP Computer Science using Scheme, Java, and C++. James also teaches AP Chemistry and has special computer science interests in the area of real time data acquisition and control subsystem hardware and software design.

Back to top