In the summer of 1996, our Computer Science department made the decision to use Java as the core language for our Computer Science program, beginning that fall. Although there were many Java books available, we soon discovered that most were “trade” or “hobby” books, not designed for university courses and certainly not intended to serve as introductions to Computer Science. It became clear to us that someone needed to write a “Fundamentals of Computer Science Using Java” book, and I thought, “why not me?” And now, after years of researching, testing, and writing, I can provide the book that we searched for years ago: a truly Java-based introduction to Computer Science.
In a first course in Computer Science, the primary goal is to teach the fundamentals of the field. Basic concepts are introduced with the help of a programming language that is often viewed as simply a medium through which algorithms are expressed. From that perspective, it does not matter which language is used in an introductory course, because any would suffice. In practice, however, the language can have a profound impact on the students’ learning experience. First, the style of the language constrains the way and the order in which topics can be introduced. Further, the language taught in the first course must support the rest of the curriculum. For these reasons and more, a language-defined text is an important component in an introductory course.
Object-oriented languages in particular are useful in introductory textbooks and are certainly appropriate at this time. Having an object-oriented language as the core programming language supports many courses at the higher level (e.g., software engineering, user interfaces, databases). The question is, then, which object-oriented language?
Our decision to use Java was based on a number of factors. First, we recognized Java as a pure object-oriented language, as opposed to C++, which is a hybrid, and thus does not allow the programmer to fall back into procedural habits. Further, it has a relatively clear and common syntax that can be understood without having to learn a large class hierarchy. Finally, Java has compilers available on a great many platforms that are inexpensive, not overly resource hungry, and the code is platform-independent. All of these things make Java ideal for a first university course.