Amazon.com: The Java/C++ Cross Reference Handbook with CDROM (Hewlett-Packard Professional Books) (0076092002581): Frederick Chew: Books

Have one to sell? Sell yours here
The Java/C++ Cross Reference Handbook with CDROM (Hewlett-Packard Professional Books)
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

The Java/C++ Cross Reference Handbook with CDROM (Hewlett-Packard Professional Books) [Paperback]

Frederick Chew (Author)
2.2 out of 5 stars  See all reviews (6 customer reviews)


Available from these sellers.



Book Description

December 1997 Hewlett-Packard Professional Books
84831-7 *Java( vs. C++: Direct, unbiased comparisons *Slash your learning curve! *Easy Q&A format *Extensive sample code *JavaaA A for C++ developers *C++ for JavaaA A developers The nuts-and-bolts JavaaA A /C++ comparison you've been waiting for! C++ developers: Learn Java now! Java developers: Learn C++ now! If you know either language, leverage what you already know to become an expert on both Java and C++! Slash your learning curve with this exceptionally practical reference, full of easy-to-use Q&As, sample code, and unbiased comparisons that'll make you productive fast. Discover: *Techniques you already know that'll keep working with little or no change *Subtle but critical differences between C++ and Java *Habits you'd better "unlearn" fast Through real-world examples, compare how Java and C++ handle: *Literals, keywords, operators, and basic constructs *Environmental differences *Java and C++ classes, inheritance, polymorphism, and exception handling *Obtaining runtime type information about objects Review the application services available to Java applications, and how they compare to C++ equivalents in UNIX and Windows NTaA A .Learn how the C++ iostream class framework compares with the Java stream classes of package java. io. Discover the basics of multiprocessing and multithreading in both Java and C++. Compare event trapping in Java and NT C++ message-driven environments, and see how Java windows management stacks up against OSF/Motif. Compare sockets, client/server programming, and TCP/IP internetworking in Java and C++. The CD-ROM includes more than 100 sample programs, plus 32-bit Windows versions of the Java Developer's Kit (JDK) version 1.1.3aA A and trial versions of Symantec's Visual CafeaA A and Visual PageaA A . Whether you're migrating to Java, a Java programmer being asked to work in C++, or even a procedural programmer who wants to learn both languages, you won't find a more practical reference than The Java/C++ Cross-Reference Handbook.

Editorial Reviews

From the Inside Flap

Preface


The Story Behind this Book

At the time of this writing, I have been an employee of the Hewlett-Packard Company for over fifteen years. Over the years I have worked in many entities, played different roles and have experienced many changes within the company. My technical literary journey started when I had joined HP's North American Response Center around 1987, where I became a member of a personal computer support team. During that period, I had contributed articles to the now defunct HP PC Communicator, a pocket-size journal that was delivered to HP customers. Since then, I have written articles for HP Professional, Interact and hp-ux/usr magazines. The latter two are publications of INTEREX, an organization representing all HP trade customers.

During that period of my career, I had also joined an internal company program called "HP AHEAD." HP AHEAD is an after-hours training program to benefit HP employees, a sort of community college within the company for those who work around the San Francisco Bay Area. The program is a great way for employees with special expertise to share their knowledge and broaden their horizons. For myself, I have been engaged in after-hours instruction for over ten years and have designed, developed and delivered five courses. The latest and most recent work is a comprehensive course I call Objects11: C++ Programming Fundamentals, a course to help the experienced C programmer enter the world of C++ programming. Now, the reader might be wondering what technical instruction and technical writing has to do with this book. For some years, I have dreamt of becoming an author, but I was not sure if I was up to the task. In many ways, writing a book is like developing a course, except the discipline, effort and the risks are immensely greater. Compared to writing an article, writing a book is an effort of a titanic scale. In January 1995, I had an article about C++ exception handling published in INTEREX's hp-ux/usr magazine. Shortly after the article's release, Pat Pekary of Hewlett-Packard Professional Books had given me a call to congratulate me on the article. Up to then, I did not know, nor had I ever worked with Pat. The amazing thing about the entire conversation was that she had actually encouraged me to write a book! It is extremely rare in life that someone you do not know actually approaches you and tells you that you have "the right stuff." Too often, individuals with great potential are discouraged or denied the opportunity to excel because they are not chosen by, or part of, a special nobility. I thank Pat for opening the door to make my dream of becoming an author possible. In addition, I hope my example will lend encouragement and hope to other individuals with the same dreams.

Acknowledgments

For myself, writing this book was a great, personal mission requiring an extraordinary amount of planning, patience, and persistence. I believe any author will testify that these virtues are absolutely necessary for success. However, despite all of the hard work of the individual author, it is the team effort of all concerned who make the book a reality. Toward this effort, I would like to acknowledge the hard-working people at Prentice Hall for making the mission a wonderful success. My thanks to Nicholas Radhuber for keeping the production of the book on track, to Mary Franz for making the book the most customer-friendly product it could be, and to Miles Williams for his imaginative and witty idea of the graphic that adorns the front cover of the book. Last, but not least, my thanks goes to all who have reviewed or given feedback to improve the content and clarity of the book.

The Audience for the Book

This book is for the software professional who has anything to do with software development: development, instruction, learning or consulting. I have written this book in the same spirit that I developed and taught my C++ course. In other words, this work is to serve as a bridge to help seasoned professionals of an established technology (C++) embrace and become proficient in a rising technology (Java).
To say that Java is merely a rising technology is probably an understatement. In the very short time since its formal release, there has been tremendous interest in this Internet technology. Businesses that are interested in publicizing their products and services on the World Wide Web are competing to find Java-knowledgeable developers. For software professionals, the possibilities for career growth and financial gain have never been better.
In this day and age, a software professional cannot afford to be complacent, otherwise he will be left behind in the employment marketplace. Unfortunately, many of the new technologies are not easily learned or mastered. It takes initiative and long-term dedication to become proficient at a new skill. There are those who would give the impression that Java is simply another dialect of C++. However, beyond the many syntactic similarities, writing a meaningful Java application with only C++ experience is not trivial. There are many C++ constructs, semantics and practices that do not apply to the Java environment. Conversely, there are elements in Java that have no equivalents in C++.
However, an experienced C++ developer is in a good position to integrate Java into his technical skill set. It is mostly a matter of unlearning some things, understanding the equivalent things, learning some new things, changing habits and a lot of practice. The purpose of this book is to address these aspects and to demonstrate the differences by example. I believe this is where my book differs from other Java books: I do not merely talk about the differences between Java and C++, I demonstrate them. I believe this approach will shorten the learning curve tremendously and help the developer internalize the subtle, but important, differences between the two languages.
For the experienced C language developer who has yet to enter the world of object-oriented programming with either C++ or Java, this book will guide the developer into both languages. Learning both of these popular languages will give the traditional, procedural language programmer valuable skills in the technical marketplace.

The Organization of the Book

The heart of the book compares the language features of C++ and Java. The first six chapters discuss and demonstrate the syntactic and semantic features of both languages. Chapter 1 gives an overview of the environmental differences surrounding a C++ application versus a Java application. Chapter 2 discusses the literals, keywords, operators and basic constructs of both languages. Chapter 3 focuses on how each language implements the notion of the class. Chapter 4 introduces how inheritance is supported in both languages. In addition, this chapter discusses supporting constructs like member access restrictions, virtual functions and abstract classes. Chapter 5 discusses how to obtain run-time type information about an object in either language. Chapter 6 covers the exception handling mechanism in both languages. This chapter demonstrates how to regulate the flow of control when exceptions are thrown. The last four chapters go beyond the standard features of the languages to compare services typically required by any application. Such services include functions or classes to support file input-output, window control layout and network programming. The comparisons span multiple platforms, where a Java example is compared to a popular, native C or C++ example from UNIX or Microsoft Windows NT. Chapter 7 compares the C++ iostream class framework with the Java stream classes of package java.io. Chapter 8 discusses multiprocessing versus multithreading, with the main focus on how to do the latter in Java. Chapter 9 discusses how events could be trapped in message-driven environments such as Microsoft Windows NT and Java. In addition, a major portion of the chapter is devoted to window layout management in Java as compared to OSF Motif. Chapter 10 discusses and demonstrates how to do client-server programming with sockets in both Java and C.


The Sample Programs

The great majority of the Java and C++ sample programs were conceived from a Microsoft Windows NT® environment (version 3.51 or higher). All of these programs come with sources, bytecode files or executables. All of these samples should work fine in the Windows 95® environment. At the time of the actual writing, all of the Java samples were built with Symantec Caf® 1.0 and version 1.0.2 of the Java Developers Kit® (JDK). Since the book had entered production, the JDK has undergone a major revision to 1.1. All of the Java samples have been tested with JDK 1.1.1 and, with the exception of a handful, have been verified to work with the new version. For the corner cases, version 1.1.1-specific examples have been provided on the media. The great majority of the C++ samples from Windows NT® were composed with Microsoft Visual C++ 4.0®. Since this version of the Microsoft compiler does not support all of the ISO/ANSI exception handling specifications, there are a few examples that are more suited to the Borland C++ 5.0® compiler. The Borland-specific example is noted as such in the comment header at the top of the source file. A small handful of C sample programs were created on a HP-UX 9.0 environment. These programs come with sources and shell scripts to create the executables. The sources and scripts must be network copied to a UNIX environment with a utility like FTP. The OSF Motif®-based examples require certain development libraries to be in place before the executables can be built. For directory structure and installation instructions, please refer to the section entitled About the Software at the end of this book.

Interesting Web Sites

There is certainly no shortage of information about Java from different Internet sources.

About the Icons

Sprinkled throughout the book are graphical icons that serve to emphasize certain passages in the text. Such icons may draw the reader's attention to warnings, recommended practices or simply the fact that a program listing is available from the distribution media. Below are the icons and their meaning:

This icon is a warning. In other words, be watchful of pitfalls.

This icon is a note or observation. The connotation is neither negative nor positive.

This icon represents enlightenment. The point emphasized is a recommended software engineering practice.

The program source code is available on the CD-Rom. v

The Java/C++ Cross-Reference Handbook # Contents #

The Java/C++ Cross-Reference Handbook # Contents # xi

The Java/C++ Cross-Reference Handbook # Preface #

The Java/C++ Cross-Reference Handbook # Preface # xvi About the Author


Frederick F. Chew is a graduate of the University of Santa Clara and has a B.S. degree in mathematics. He has been an employee of the Hewlett-Packard Company for over fifteen years and is currently an Information Technology Engineer with Hewlett-Packard's Asia-Pacific Geography. He is also a C++ instructor with the HP AHEAD program and is a contributor of articles on object-oriented software development to INTEREX's hp-ux/usr magazine.

xvii xviii

From the Back Cover

  • Java( vs. C++: Direct, unbiased comparisons
  • Slash your learning curve!
  • Easy Q&A format
  • Extensive sample code
  • Java™ for C++ developers
  • C++ for Java™ developers

The nuts-and-bolts Java™/C++ comparison you've been waiting for!

C++ developers: Learn Java now! Java developers: Learn C++ now!

If you know either language, leverage what you already know to become an expert on both Java and C++! Slash your learning curve with this exceptionally practical reference, full of easy-to-use Q&As, sample code, and unbiased comparisons that'll make you productive fast. Discover:

  • Techniques you already know that'll keep working with little or no change
  • Subtle but critical differences between C++ and Java
  • Habits you'd better "unlearn" fast

Through real-world examples, compare how Java and C++ handle:

  • Literals, keywords, operators, and basic constructs
  • Environmental differences
  • Java and C++ classes, inheritance, polymorphism, and exception handling
  • Obtaining runtime type information about objects

Review the application services available to Java applications, and how they compare to C++ equivalents in UNIX and Windows NT™. Learn how the C++ iostream class framework compares with the Java stream classes of package java.io. Discover the basics of multiprocessing and multithreading in both Java and C++. Compare event trapping in Java and NT C++ message-driven environments, and see how Java windows management stacks up against OSF/Motif. Compare sockets, client/server programming, and TCP/IP internetworking in Java and C++.

The CD-ROM includes more than 100 sample programs, plus 32-bit Windows versions of the Java Developer's Kit (JDK) version 1.1.3™ and trial versions of Symantec's Visual Cafe™ and Visual Page™.

Whether you're migrating to Java, a Java programmer being asked to work in C++, or even a procedural programmer who wants to learn both languages, you won't find a more practical reference than The Java/C++ Cross-Reference Handbook.


Product Details

  • Paperback: 480 pages
  • Publisher: Prentice Hall PTR (December 1997)
  • Language: English
  • ISBN-10: 0138483183
  • ISBN-13: 978-0138483180
  • Product Dimensions: 9 x 7 x 1.3 inches
  • Shipping Weight: 2.2 pounds
  • Average Customer Review: 2.2 out of 5 stars  See all reviews (6 customer reviews)
  • Amazon Best Sellers Rank: #3,137,831 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

6 Reviews
5 star:
 (1)
4 star:    (0)
3 star:    (0)
2 star:
 (3)
1 star:
 (2)
 
 
 
 
 
Average Customer Review
2.2 out of 5 stars (6 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

13 of 13 people found the following review helpful:
1.0 out of 5 stars Totally useless and misleading, April 8, 1999
By A Customer
This review is from: The Java/C++ Cross Reference Handbook with CDROM (Hewlett-Packard Professional Books) (Paperback)
(1) NOT for those who know C++ or Java. The book assumes you know NOTHING. You will find four (4) pages devoted to "while", "break", "continue", just to learn that they are identical in Java and C++.

(2) Full of pagecount-boosting source code, which only makes it harder to get to the gist, whether you are beginner or experienced programmer.

(3) Many differences are not mentioned at all (e.g., in C++ multi-dimensional arrays supposedly can be built only manually with pointers -- int a[2][3] is ignored).

(4) Any non-trivial differences are only mentioned, but not elaborated -- i.e., you are on your own if you want to know how to rewrite in Java your C++ code, or how performance is affected by a given feature (take array bound checking, or the fact that built-in types in Java cannot be passed by reference, pointer-to-member operator being impossible in Java, etc.).

(5) Explanations are very confusing, partly because the book doesn't take one language as a basis. It tries to go both from C++ to Java and from Java to C++ in the same book, which proved to be impossible (at least for its author).

(6) Some facts are incorrect (e.g., pointer-to-member operators are called "redundant" in C++; I'm too lazy to look for more serious errors).

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


6 of 6 people found the following review helpful:
2.0 out of 5 stars very misleading title, July 2, 1999
By A Customer
This review is from: The Java/C++ Cross Reference Handbook with CDROM (Hewlett-Packard Professional Books) (Paperback)
The title made me buy the book, but actually this trick is the smartest thing in the whole book.

This is not a cross-reference. It's a text book, but a poor one.

For an experienced C++ programmer there are too many pages of trivialities to wade through. The authour seems to have little background on languages and compilers.

For a beginner things are not explained well.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


6 of 6 people found the following review helpful:
2.0 out of 5 stars Doesn't deliver on its promises, April 8, 1999
By A Customer
This review is from: The Java/C++ Cross Reference Handbook with CDROM (Hewlett-Packard Professional Books) (Paperback)
The book has low signal-to-noise ratio, lots of ommissions, and extremely poor and superficial explanations.

Maybe because it attempts to be everything to everyone: both textbook and reference; for both novices and experts; good for Java and C++ and even C developers. While this is an excellent marketing ploy, it is dishonest to the book readers. The author or the publisher should have seen the problem, and changed their target to something more modest.

Frankly, I bought the book with very high expectations: I thought with 450 pages devoted solely to the differences between C++ and Java, it must go to a lot of depth and subtleties. What a disappointment... I am still looking for a real "Java for Experienced C++ Developers" kind of book.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews




Only search this product's reviews



Tag this product

 (What's this?)
Think of a tag as a keyword or label you consider is strongly related to this product.
Tags will help all customers organize and find favorite items.
Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums


Listmania!


Create a Listmania! list

So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject