The Java/C++ Cross Reference Handbook

Preface. 1. Beyond Appearances: Different by Design. Applications or Applets? The Java Virtual Machine. Memory Management: Public Service or Do It Yourself? Printing to the Standard Output Device. 2. The Basics of the Languages. Identifiers. The Keywords of Java and C++. The Char Type. The Boolean Type. The Built-In Types. An Overview of the Operators. The Order of Evaluation of the Operands. The Role of the Semicolon. Flow of Control: Branching. Flow of Control: Iteration. Flow of Control: The break and continue Keywords. Setting Up Arrays. Array of Arrays. Declaring an Array of a Type. Passing Parameters into Functions or Methods. Passing Arguments from the Command Line. Macros, the const Keyword and the final Keyword. Comment Delimiters. Documenting Java Code with JavaDoc. 3. The Class: Blueprint for Object Creation. A Basic Overview of the Class. A Strictly C++ Style for Writing a Class. A Closer Look at Constructors. Calling a Constructor from a Constructor Using Keyword This. C++ Destructors and Java Finalizers. The C++ Copy Constructor. Overloading the Assignment Operator in C++. Cloning Objects in Java. Comparing References and Objects in Java and C++. Using the String and StringBuffer Classes in Java. Static Variables and Methods. 4. Inheritance: Up and Down the Class Hierarchy. Inheritance as an "is-a" Relationship. Organizing Java Classes into a Package. Resolving Name Collisions with C++ Namespaces and Java Packages. Visibility for the Subclasses: C++ protected and Java private protected. Widening the Visibility: the Java protected Keyword. The Default Visibility Modifier for the Java Method. Final Methods and Final Classes in Java. Dynamic Method Lookup and Virtual Functions. Abstract Classes in Java and C++. Multiple Inheritance and Interfaces. Ambiguity and Virtual Base Classes. 5. Run-Time Type Information. An Overview of Run-Time Type Information. The Java instance of Operator. The C++ dynamic_cast operator. Creating Objects Dynamically in Java. 6. Dealing with the Unexpected: Exception Handling. The Case for Defensive Programming. The throw, throws, try and catch Keywords. Ordering the Catch Handlers. C++ Destructors and the Unwinding of the Stack. Rethrowing an Exception for Further Processing. Cleaning Up with the Java finally Block. Redirecting the Flow of Control with C++ set_unexpected. Using C++ set_terminate to Dispose of Resources. A Useful Java Method for Debugging: printStackTrace(). Uses and Misuses of Exception Handling. 7. The Land of Streams: Input and Output. An Overview of the C++ and Java Stream Classes. Getting Input with C++ ifstream and Java DataInputStream. Generating Output with C++ ofstream and Java PrintStream. Finding the Attributes of a File. Formatting Output in C++. Formatting Output in Java with Class IOS. 8. Threads: Charting Multiple Courses. Processes, Threads and Java. The Java Thread Class. The Java Runnable Interface. Contention for Resources and the Java synchronized Keyword. Waiting for Conditions to Change with wait() and notify(). Organizing Java Threads into a ThreadGroup. 9. The Java AWT: Windows to Many Worlds. The Quest for a Common Denominator. The Java AWT Event-Driven Environment. Events in a Microsoft Foundation Class Environment. Converting a Stand-Alone Java Application to an Applet. Simple Layout Managers. Stacking the Deck: The CardLayout Manager of Java. Optimizing Flexibility with the Java GridBagLayout Manager. 10. Networking the Java Environment. The World of Client-Server Computing. A File Retrieval Service in C. The File Retrieval Service in Java. Accessing Uniform Resource Locators. References. Index. About the Software.