Programming Books C Java PHP Python Learn more Browse Programming Books
Buy Used
FREE Shipping on orders over $35.
Condition: Used: Good
Comment: ELIGIBLE FOR *FREE* SUPER SAVER SHIPPING. AMAZON CUSTOMER SERVICE WITH DELIVERY TRACKING. Book may have moderate wear to corners and edges. CD may or may not be included. Could be ex-library.
Access codes and supplements are not guaranteed with used items.
Add to Cart
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Core Java 2, Volume 1: Fundamentals (The Sun Microsystems Press Java Series) Paperback – December 18, 2000

ISBN-13: 978-0130894687 ISBN-10: 0130894680 Edition: 5th

Price: $4.70
10 New from $16.54 52 Used from $0.01 1 Collectible from $9.98
Amazon Price New from Used from
"Please retry"
$16.54 $0.01

There is a newer edition of this item:



Save up to 90% on Textbooks
Rent textbooks, buy textbooks, or get up to 80% back when you sell us your books. Shop Now

Product Details

  • Paperback: 832 pages
  • Publisher: Prentice Hall PTR; 5 edition (December 18, 2000)
  • Language: English
  • ISBN-10: 0130894680
  • ISBN-13: 978-0130894687
  • Product Dimensions: 9.2 x 7 x 2.2 inches
  • Shipping Weight: 3.5 pounds
  • Average Customer Review: 4.4 out of 5 stars  See all reviews (33 customer reviews)
  • Amazon Best Sellers Rank: #666,111 in Books (See Top 100 in Books)

Editorial Reviews

From the Inside Flap

To the Reader

In late 1995, the Java programming language burst onto the Internet scene and gained instant celebrity status. The promise of Java is that it will become the universal glue that connects users with information, whether that information comes from Web servers, databases, information providers, and any other imaginable source. Indeed Java is in a unique position to fulfill this promise. It is an extremely solidly engineered language that has gained acceptance by all major vendors, except for Microsoft. Its built-in security and safety features are reassuring both to programmers and to the users of Java programs. Java even has built-in support that makes advanced programming tasks, such as network programming, database connectivity, and multithreading, straightforward.

Since then, Sun Microsystems has released four major revisions of the Java Software Development Kit. Version 1.02, released in 1996, supported database connectivity and distributed objects. Version 1.1, released in 1997, added a robust event model, internationalization, and the Java Beans component model. Version 1.2, released at the end of 1998, has numerous enhancements, but one major improvement stands out: the "Swing" user interface toolkit that finally allows programmers to write truly portable GUI applications. Version 1.3, released in the spring of 2000, delivered many incremental improvements.

The book you have in your hand is the first volume of the fifth edition of the Core Java book. Each time, the book followed the release of the Java development kit as quickly as possible, and each time, we rewrote the book to take advantage of the newest Java features.

As with the previous editions of this book, we still target serious programmers who want to put Java to work on real projects. We still guarantee no nervous text or dancing tooth-shaped characters. We think of you, our reader, as a programmer with a solid background in a programming language. But you do not need to know C++ or object-oriented programming. Based on the responses we have received to the earlier editions of this book, we remain confident that experienced Visual Basic, C, or COBOL programmers will have no trouble with this book. (You don't even need any experience in building graphical user interfaces in Windows, Unix, or the Macintosh.)

What we do is assume you want to:

Write real code to solve real problems


Don't like books filled with toy examples (such as kitchen appliances or fruit trees).

You will find lots of sample code on the accompanying CD that demonstrates almost every language and library feature that we discuss. We kept the sample programs purposefully simple to focus on the major points, but, for the most part, they aren't fake and they don't cut corners. They should make good starting points for your own code.

We assume you are willing, even eager, to learn about all the advanced features that Java puts at your disposal. For example, we give you a detailed treatment of:

Object-oriented programming

Reflection and proxies

Interfaces and inner classes

The event listener model

Graphical user interface design with the Swing UI toolkit

Exception handling

Stream input/output and object serialization

We still don't spend much time on the fun but less serious kind of Java programs whose sole purpose is to liven up your Web page. There are quite a few sources for this kind of material already—we recommend John Pew's book Instant Java, also published by Sun Microsystems Press/Prentice Hall.

Finally, with the explosive growth of the Java class library, a one-volume treatment of all the features of Java that serious programmers need to know is no longer possible. Hence, we decided to break the book up into two volumes. The first volume, which you hold in your hands, concentrates on the fundamental concepts of the Java language, along with the basics of user-interface programming. The second volume goes further into the enterprise features and advanced user-interface programming. It includes detailed discussions of:


Network programming

Distributed objects

Collection classes


Advanced graphics

Advanced GUI components


Native methods


When writing a book, errors and inaccuracies are inevitable. We'd very much like to know about them. But, of course, we'd prefer to learn about each of them only once. We have put up a list of frequently asked questions, bugs fixes, and workarounds in a Web page at horstmann/corejava.html. Strategically placed at the end of the FAQ (to encourage you to read through it first) is a form you can use to report bugs and suggest improvements. Please don't be disappointed if we don't answer every query or if we don't get back to you immediately. We do read all e-mail and appreciate your input to make future editions of this book clearer and more informative.

We hope that you find this book enjoyable and helpful in your Java programming. About This Book

Chapter 1 gives an overview of the capabilities of Java that set it apart from other programming languages. We explain what the designers of the language set out to do and to what extent they succeeded. Then, we give a short history of how Java came into being and how it has evolved.

In Chapter 2, we tell you how to install Java and the companion software for

this book from the CD-ROM onto your computer. Then we guide you through compiling and running three typical Java programs, a console application, a graphical application, and an applet.

Chapter 3 starts the discussion of the Java language. In this chapter, we cover the basics: variables, loops, and simple functions. If you are a C or C++ programmer, this is smooth sailing because the syntax for these language features is essentially the same as in C. If you come from a non-C background such as Visual Basic or COBOL, you will want to read this chapter carefully.

Object-oriented programming (OOP) is now in the mainstream of programming practice, and Java is completely object oriented. Chapter 4 introduces encapsulation, the first of two fundamental building blocks of object orientation, and the Java language mechanism to implement it, that is, classes and methods. In addition to the rules of the Java language, we also give advice on sound OOP design. Finally, we cover the marvelous javadoc tool that formats your code comments as a set of hyperlinked web pages. If you are familiar with C++, then you can browse through this chapter quickly. Programmers coming from a non-object-oriented background should expect to spend some time mastering OOP concepts before going further with Java.

Classes and encapsulation are only one part of the OOP story, and Chapter 5 introduces the other, namely, inheritance. Inheritance lets you take an existing class and modify it according to your needs. This is a fundamental technique for programming in Java. The inheritance mechanism in Java is quite similar to that in C++. Once again, C++ programmers can focus on the differences between the languages.

Chapter 6 shows you how to use Java's notion of an interface. Interfaces let you go beyond the simple inheritance model of Chapter 5. Mastering interfaces allows you full access to the power of Java's completely object-oriented approach to programming. We also cover a useful technical feature of Java here. These are called inner classes. Inner classes help make your code cleaner and more concise.

In Chapter 7, we begin application programming in earnest. We show how you can make windows, how to paint on them, how to draw with geometric shapes, how to format text in multiple fonts, and how to display images.

Chapter 8 is a detailed discussion of the event model of the AWT, the abstract windows toolkit. (We discuss the event model that was added to Java 1.1, not the obsolete and simplistic 1.0 event model.) You'll see how to write the code that responds to events like mouse clicks or key presses. Along the way you'll see how to handle basic GUI elements like buttons and panels.

Chapter 9 discusses the Swing GUI toolkit in great detail. The Swing toolkit is how you can use Java to build a cross-platform graphical user interface. You'll learn all about the various kinds of buttons, text components, borders, sliders, list boxes, menus, and dialog boxes. However, some of the more advanced components are discussed in Volume 2.

After you finish Chapter 9, you finally have all mechanisms in place to write applets, those mini-programs that can live inside a Web page, and so applets are the topic of Chapter 10. We show you a number of useful and fun applets, but more importantly, we show you what goes on behind the scenes. And we show you how to use the Java Plug-in that enables you to roll out applets that take advantage of all the newest Java features, even if your users use old browsers or browsers made by hostile vendors.

Chapter 11 discusses exception handling, Java's robust mechanism to deal with the fact that bad things can happen to good programs. For example, a network connection can become unavailable in the middle of a file download, a disk can fill up, and so on. Exceptions give you an efficient way of separating the normal processing code from the error handling. Of course, even after hardening your program by handling all exceptional conditions, it still might fail to work as expected. In the second half of this chapter, we give you a large number of useful debugging tips. Finally, we guide you through sample sessions with various tools: the JDB debugger, the debugger of the Forte development environment, a profiler, a code coverage testing tool and the AWT robot.

We finish the book with input and output handling. In Java, all I/O is handled through so-called streams. Streams let you deal in a uniform manner with communicating with any source of data, such as files, network connections, or memory blocks. We include detailed coverage of the reader and writer classes, which make it easy to deal with Unicode; and we show you what goes on under the hood when you use object serialization mechanism, which makes saving and loading objects easy and convenient.

An appendix lists the Java language keywords.CD-ROM

The CD-ROM on the back of the book contains the latest version of the Java Software Development Kit. At the time we are writing this, these materials are available only for Windows 95/NT or Solaris 2.

Of course, the CD-ROM contains all sample code from the book, in compressed form. You can expand the file either with one of the familiar unzipping programs or simply with the jar utility that is part of the Java Software Development Kit.

The CD-ROM also contains a small selection of "best of breed" programs that you may find helpful for your development. Generally, these programs require that you pay the vendors some amount of money if you use them beyond a trial period. We have no connection with the vendors, except as satisfied users of their products. Please contact the vendors directly with any questions you may have about the programs.

NOTE: People have often asked what the licensing requirements for using the sample code in a commercial situation are. You can freely use any code from this book for non-commercial use. However, if you do want to use the code as a basis for a commercial product, we simply require that every Java programmer on the development team for that project own a copy of Core Java.

From the Back Cover

  • The experienced developer's guide to Java programming—now fully updated for JDK 1.3
  • Completely revised coverage of object-oriented development and Swing classes
  • More of the robust code examples professional programmers need
  • CD-ROM includes all source code, J2SE Version 1.3, Forte for Java Community Edition, and much more!

Raves for the previous edition!

"Devoid of shaky, academic examples and packed with robust demonstrations that illustrate hundreds of powerful concepts ...The authors back up the many examples with sharp, fact-rich commentary on how to get things done with Java."

—David Wall,

The best-selling guide for serious Java 2 programmers—fully updated for JDK 1.3!

Ask any experienced Java programmer: Core Java delivers the real-world guidance you need to accomplish even the most challenging tasks. That's why it's been an international best seller for five straight years. Core Java 2, Volume 1 covers the fundamentals of Java 2, Standard Edition, Version 1.3 and includes completely revised discussions of object-oriented Java development, enhanced coverage of Swing user interface components, and much more.

This new fifth edition delivers even more of the robust, real-world programs previous editions are famous for—updated to reflect deployment and performance enhancements. Volume 1 includes thorough explanations of inner classes, dynamic proxy classes, exception handling, debugging, the Java event model, Input/Output, file management, and much more. For experienced programmers, Core Java 2, Volume 1: Fundamentals sets the standard—again!

State-of-the-art information for Java developers, including:

  • Building GUI applications with Swing classes
  • Making the most of dynamic proxy classes and inner classes
  • Mastering the Java event model
  • Understanding Java streams and file management

About the CD-ROM

CD-ROM contains complete source code examples, the Java 2, Standard Edition, Version 1.3 SDK, and useful tools, including Forte for Java, Community Edition, a complete toolset for Java application development, TextPad 4.32, HexWorkshop 3.1, WinZip 8.0, Together J, and SourceAgain.

More About the Author

Cay S. Horstmann is also coauthor of Core JavaServer Faces, Second Edition (Prentice Hall, 2007). Cay is a professor of computer science at San Jose State University, a Java Champion, and a frequent speaker at computer industry conferences.

Customer Reviews

The explanations, examples, coverage of topics are great.
Brian Mello
I would definately recommend this book to anyone with prior OOP experience (even a little) who need to learn the JAVA langugage.
E. James OKelly
Although this book is titled Volum I--Fundamentals, it covers quite a lot.
Vincent S. Yeung

Most Helpful Customer Reviews

22 of 22 people found the following review helpful By E. James OKelly on August 18, 2001
Format: Paperback
If you have a background in either C++ or even Visual Basic and need to learn JAVA, this book is for you!
I have a background in both and needed to add JAVA to my skillset for work. I bought Ivor's Beginner JAVA from Wrox (usually my favorite publisher) but found the book full of errors and typos. To top it off all the examples were very math related and didn't give me a "real-world" sense for what JAVA could do for me.
This book is just the opposite. With great insight and tips for people with VB and C++ backgrounds, easy (and fun) reading, and in-depth coverage of the language, this book was the answer to my cries.
The Authors are very adept with the language and have excellent writing skills. Volume I game me what I needed to begin my path towards the interpreted dark side :), but Volume II is definately needed for Client-Server coding, and more advanced topics.
I would definately recommend this book to anyone with prior OOP experience (even a little) who need to learn the JAVA langugage.
I was also very impressed by the non-hype, and the lack of Microsoft bashing. Core JAVA 2 is a must read.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
10 of 10 people found the following review helpful By Vincent S. Yeung on August 9, 2001
Format: Paperback
The book says it's geared towards more experienced programmers, and this is quite true. The authors don't really spend time going over the basics but instead directly dive into the meat of Java programming.
As the cover claims, the authors use more "practical" examples in their code. For example, instead of using trees and animals to demonstrate object hierarchies and inheritance, they use an employee class (although that is actually quite common).
The concepts are explained clearly with little junk or excess information. That's what makes this book a gem. Every sentence is helpful.
While some people did not enjoy them, I particularly liked the "C/C++" and "VB" notes since I have background in both langauges. They illustrate key differences between these languages and Java. For example, one C++ note mentioned that you can only call constructors using the new keyword, and another mentioned that there is no destructor method in Java due to automatic garbage collection.
Although this book is titled Volum I--Fundamentals, it covers quite a lot. There is extensive coverage of using Swing to build UI's and other things like also streams.
In sum, this is a great book to learn Java with, particularly for those with prior programming experience and only want to know the useful stuff about Java.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
40 of 49 people found the following review helpful By A Customer on April 13, 2001
Format: Paperback
I learned JAVA with the 2 CORE JAVA books (1 & 2)
The reader form PA who rated it a 1 star book is nuts.
>First off, does it have to be so fat? I don't think so. I am tired of the bloated technical books. Our time is too valuable.
Its comprehensive, well written, full of examples, and actually FUN to read. Very rare for a technical work.
>Second, the examples are bad and explanations are horrible.
No the examples are comprehensive and excellent. Very helpful for some of the Swing/AWT classes.
>Note how the authors explain how local anonymous inner classes should be avoided and then use them in every example afterwards.
In general Anonymous inner classes should be avoided, but small ones are ok, and the authors give an example. If you dont want to make the class anonymos then dont. Its just an example, and they explain all you need.
>Notice how OO principles are disregarded in the first big example.
No I didnt notice, they do an excellent job explaining OO principles.
> Notice how the chapter on inheritance talks extensively about reflectivity which has only tangential bearing. Also, there is a lot of "This doesn't work here, but don't worry about that now" and "I know we didn't bring this up yet, but you will see this 5 chapters on". It's called forethought - try it!
No its called complesity. Rather than assuming the readers have extensive OO experience they provide some background. To throw in everything would be too complex at the start.
>Third, too much time spent on GUI topics.
I disagree. Its an important subject and complex. To spend less time would be worthless. I found the GUI coverage to be good, and bought the 4 volume set to get complete coverage.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
9 of 9 people found the following review helpful By Martha S. Pepper on September 14, 2002
Format: Paperback
This is a great book but there is a new edition. Go to ISBN number 0130471771.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
7 of 8 people found the following review helpful By Riccardo Audano on July 4, 2001
Format: Paperback
I have read and browsed through quite some Java books and I found this one particularly impressive. The style is a bit academic but very clear, concise but understandable. It just makes you feel that the authors should relax a bit, their only defect is they fail to convey the idea that Java is a beautiful language and programming can be fun.(Somehow you get the imprssion that they don't really like Java..). Anyways the material presented is great, the examples are solid but simple enough for you not get lost, and it is full of interesting complex points like reflection and inner classes that get finally explained in a clear and non pretentious way. It also has a lot of examples on Swing components, applets and file I/O. The second volume seems to be even better! This is one of the TWO best Java book. The other one is Beginning Java Programming by Ivor Horton. Buy Core Java if your priority is on style. Buy Ivor's book for a more pleasurable and more "tutorial-like" (but still solid) experience. If possible, buy them both!
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Customer Images

Most Recent Customer Reviews


What Other Items Do Customers Buy After Viewing This Item?