Home > Store

Core Java 1.1 Volume 2: Advanced Features, 3rd Edition

Register your product to gain access to bonus material or receive a coupon.

Core Java 1.1 Volume 2: Advanced Features, 3rd Edition

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Helps experienced programmers get to the heart of Java's advanced features quickly and easily.
  • This book includes all-new coverage of the Java Database Connectivity API (RMI, JDBC, native methods, etc.) for integrating Java applets with existing databases.
  • Core Java 1.1, Volume II also includes new information about the Java Beans component model.
  • Provides extensive coverage of how to effectively implement multithreaded Java software.
  • Includes detailed discussions of both IDL and object libraries.

Description

  • Copyright 1998
  • Edition: 3rd
  • Book
  • ISBN-10: 0-13-766965-8
  • ISBN-13: 978-0-13-766965-3


76696-4

“Core Java is the best choice for experienced programmers. It is unmatched for technical depth, yet remains highly readable.” —K.N. King, Computer Reviews

Comprehensive and up-to-date coverage of advanced topics including:

  • input and output
  • object serialization
  • multithreading
  • network programming
  • distributed objects
  • databases
  • native methods
  • Java Beans

Put Java to work on real problems!

Written for serious programmers who have mastered the fundamentals of the Java language, Core Java 1.1, Vol. II thoroughly explains the more advanced features and libraries you need to build real programs.

New chapters on Java Beans, Advanced AWT, Security, and Internationalization focus on the features and functions added to Java with the release of JDK 1.1. Updated chapters on multithreading and networking include extensive examples and thoroughly tested sample code that illustrate some of the most powerful features of Java.

Volume II also provides in depth coverage of the Java Enterprise API-JDBC, RMI, Native Methods-that demonstrates what objects everywhere can be realistically used for.

The CD-ROM includes all Java source code examples from the book, the latest version of JDK 1.1.x and useful shareware as well as all of the example code from Core Java 1.1, Volume I.

Sample Content

Table of Contents



1. Streams.


2. Multithreading.


3. Networking.


4. Database Connectivity: JDBC.


5. Remote Objects.


6. Advanced AWT.


7. Java Beans.


8. Security.


9. Internationalization.


10. Native Methods.


Appendix I.


Index.

Preface

Preface

To the Reader
The book you have in your hands is the second part of the third edition of Core Java. The first edition appeared in early 1996, the second in late 1996. The first two editions appeared in a single volume, but the second edition was already 150 pages longer than the first, which was itself not a thin book. When we sat down to work on the third edition, it became clear to us that a one-volume treatment of all the features of Java that a serious programmer needs to know was no longer possible. Hence, we decided to break up the third edition into two volumes; the second volume is what you are looking at.

The first volume covered the essential features of the language; this volume covers the advanced topics that a Java programmer will need to know so that he or she will (we hope) be in a position to do commercial Java development. Thus, as with the first volume and the previous editions of this book, we still are targeting programmers who want to put Java to work on real projects.

Please note: If you are an experienced Java developer who is comfortable with the new event model and the other language features, such as inner classes, that were added to Java 1.1, you need not have read the first volume in order to benefit from this volume. (While we do refer to sections of the previous volume when appropriate and, of course, hope you will buy or have bought Volume 1, you can find the needed background material in any comprehensive introductory Java 1.1 book.)

Finally, when any book is being written, errors and inaccuracies are inevitable. We would very much like to hear about them. Of course, we would prefer to hear about them only once. For this reason, we have put up a Web page at http://www.horstmann.com with an FAQ, bug fixes, and workarounds. Strategically placed at the end of the Web page (to encourage you to read the previous reports) is a Java applet that you can use to report bugs or problems and to send suggestions for improvements to future editions.

About This Book

First, except for Chapter 1, which is a thorough discussion of input and output in Java 1.1, the remaining chapters in this book can almost certainly be read independently of each other-only occasional backtracking will be needed at most. We suggest reading Chapter 1 first and then turning to whatever topic interests you the most in the remaining chapters. Here are short descriptions of the various chapters.

Input/output in Java is handled through what Java calls streams, which are conceptually the same as the similarly named feature of C++. Streams let you deal in a uniform manner with the large number of possible ways of getting input from any source of data that can send out a sequence of bytes and then sending it to any destination that can also work with a sequence of bytes. In particular, we include detailed coverage of the new Reader and Writer classes in Java 1.1, which make it easy to deal with Unicode; and we include the new object serialization mechanism in Java 1.1, which makes saving the state of an object almost trivial.

Chapter 2 covers multithreading, which enables you to program tasks to be done in parallel. (A thread is a flow of control within a program.) We show you how to set up threads and how to make sure none of them get stuck. We put this knowledge to practical use by example, showing you the techniques needed to build timers and animations.

Chapter 3 covers one of the most exciting APIs in Java: the one for networking. Java makes it phenomenally easy to do sophisticated network programming. Not only do we cover this API in depth, we also discuss the important consequences of the applet security model for network programming.

Chapter 4 covers the JDBC, the Java database connectivity API. We show you how to write useful programs to handle realistic databases, using a core subset of the JDBC API. Please note that this is not a complete treatment of everything you can do with the rich JDBC API. (A complete treatment of the JDBC API would certainly require a book almost as long as this one. )

Chapter 5 covers remote objects and Remote Method Invocation (RMI). This API lets you work with Java objects that are distributed over a net or running in separate processes on a single machine. We also show you where the rallying cry of "objects everywhere" can realistically be used.

Chapter 6 covers some advanced features of the Abstract Windowing Toolkit (AWT) that seemed too specialized for coverage in Volume 1 but are, nonetheless, techniques that should be part of every Java programmer's toolkit. These features include the image manipulation API and the (partially implemented) cut-and-paste API. We actually take the cut-and-paste API one step further than JavaSoft itself did: We show you how to cut and paste Java objects between different Java programs via the system clipboard.

Chapter 7 shows you what you need to know about the new component API for Java-JavaBeans_. We show you what you need to know in order to write your own Java beans. (We do not cover the various builder environments that are designed to manipulate beans, however.) The JavaBeans_ component technology is an extraordinarily important technology for the eventual success of Java because it can potentially bring the same ease of use to Java programming environments that ActiveX_ controls give to the millions of Visual Basic_ programmers out there. Of course, since these components are written in Java, they have the advantage over ActiveX controls in that they are immediately cross-platform and immediately capable of fitting into the sophisticated security model of Java.

In fact, Chapter 8 takes up that security model. Java was designed from the ground up to be secure, and this chapter takes you under the hood to see how this design is implemented. We show you how to write your own class loaders and security managers for special-purpose applications. Then, we take up the new security API that allows for such important features as signed classes.

Chapter 9 discusses a specialized feature that we feel can only grow in importance: internationalization. Java is one of the few languages designed from the start to handle Unicode. As a result, you can internationalize Java applications so that they not only cross platforms but cross country boundaries as well. For example, we show you how to write a retirement calculator applet that uses either English, German, or Chinese-depending on the locale of the browser.

Chapter 10 takes up native methods, which let you call methods written for a specific machine such as the Windows API. Obviously, this feature is controversial: Use native methods, and the cross-platform nature of Java vanishes. Nonetheless, every serious programmer writing Java applications for specific platforms needs to know these techniques. There will be times when you need to turn to the operating system's API for your target platform when you are writing a serious application. We illustrate this by showing you how to access the registry functions in Windows.

Appendix I contains instructions for installing the software and example code from the CD-ROM.
Conventions
As is common in many computer books, we use courier type to represent computer code. There are many C++ notes that explain the difference between Java and this language. You can skip over them if you aren't interested in C++.

Notes are tagged with a "notepad" icon that looks like this. Java comes with a large programming library or Application Programming Interface (API). When using an API call for the first time, we add a short summary description, tagged with an API icon. These descriptions are a bit more informal, but also a little more informative than those in the official on-line API documentation.

Programs whose source code is on the CD-ROM are listed as examples, for instance, Example 15-8: WarehouseServer.java refers to the corresponding code on the CD-ROM.

Acknowledgements

Cay's love, gratitude, and apologies go to his wife Hui-Chen and his children Tommy and Nina for their continuing support for this never-ending project. He also appreciates the support and understanding from Vincent Pluvinage and his colleagues at Preview Software.

Gary also wants to thank Cay's family. They were extraordinarily gracious as revisions came too rapidly and took far too long. He also wants to thank his friends and his co-workers for their patience as he too slowly extricated himself from the quagmire of his own overcommitments.

Next, we both want to thank Mary Lou Nohr for her great copyediting job. Her ability to mesh two conflicting writing styles and keep things consistent amazed us. David Geary, Blake Ragsdell, and Christopher Taylor provided us with very useful reviews. Next, we want to thank the people at Prentice Hall, especially our long-suffering editor Greg Doench, for coordinating this very complicated project. Rachel Borden and John Bortner, our publisher and publicist, respectively, at Sun Microsystems Press were always there to listen with a patient ear when we complained about yet another problem-and do their best to fix it. Nikki Wise and her team at Navta Associates, Inc., came through yet one more time for a project that was again on an impossible schedule. Finally, we want to thank Niko Mak (WinZip), Keith MacDonald (TextPad), and Bob Andreasen (HexWorkshop) for allowing us to include their shareware products on the CD.


Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020