Chapter 2: Baby Steps


OVERVIEW

The main goal of this chapter is to help the reader make a connection between his/her C background and some of the beginning constructs in C++ and Java. This will be accomplished by comparing simple programs in C with equally simple programs in C++ and Java that do the same thing.

The author requests the reader to be indulgent when encountering unfamiliar terms in our explanations of the C++ and Java examples in this chapter. The presence of these terms—"class," "object," "exception"—will not hinder the reader in seeing parallels between the C programs and their equivalent C++ and Java programs. On the contrary, the C++ and Java programs, and their accompanying explanations, should make the reader curious about these terms, making it easier to formally introduce them in subsequent chapters. The idea is to use the easily-established conceptual parallels between the C programs and their equivalent C++ and Java programs as a pedagogical vehicle for giving the reader a first introduction to the rudiments of OO vocabulary.

A second goal of this chapter is to familiarize the reader with command-line compilation of C++ and Java programs, as well as with the -classpath option that sometimes must be specified for Java compilation.




Programming With Objects[c] A Comparative Presentation of Object-Oriented Programming With C++ and Java
Programming with Objects: A Comparative Presentation of Object Oriented Programming with C++ and Java
ISBN: 0471268526
EAN: 2147483647
Year: 2005
Pages: 273
Authors: Avinash Kak

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net