An Overview of C++ and Java Facilities and Techniques for Defining Classes
- 2.1. Our emphasis
- 2.2. The basic goal—a major difference between C++ and Java
- 2.3. Constructors and destructor
- 2.4. Operator overloading in C++
- 2.5. Operator overloading in Java
- 2.6. Flow-control constructs
- 2.7. Manipulating character strings in C++
- 2.8. Canonical class structure
- 2.9. Overcoming macrophobia
- 2.10. Program readability
- 2.11. Error detection and exceptions
2.1. Our emphasis
This chapter is not a language tutorial. I assume you already have experience in defining object-oriented classes in C++ or Java or both. The emphasis here is on
- the choices we face among language facilities that have duplicate or overlapping functionality
- the background of various traditions in C++ and Java programming
- established principles of good programming practice as they apply to building and using object-oriented classes
Unlike later chapters, the following sections address the topics in both languages. Even if you have absolutely no immediate interest in one of the languages, you should resist the temptation to skip over those explanations. By understanding the fundamental approaches in C++ and Java and the differences between them, you’ll develop a stronger command of object-oriented class design and an informed appreciation of the strengths and weaknesses of each language.