Chapter 12: The Core Java Packages and Classes


Overview

At this point in your Java education, you have a solid foundation in the essential language. There are some Java features that have not been presented in this book, and won't be, but for the most part you know what you need to know to create programs consisting of classes and interfaces.

The remainder of this book will look at a large number of classes that have been written on your behalf and that you can incorporate into your code. You can use them freely. Moreover, since they are downloaded (along with the compiler and the JVM) whenever anyone downloads Java, you already have them, and you can safely assume that anyone who uses your code has the same set of classes.

We cannot possibly present them all in this book. There are well over a thousand core classes and interfaces, and many of them have specialized functionality that is of interest only to people with the same specialization. Instead of providing an exhaustive survey, we will just introduce the most important classes. Then we will show you how to learn all about the more specialized classes and interfaces. By the end of this chapter, you will have the same fundamental tools as any other Java programmer:

  • An understanding of the language.

  • A knowledge of certain core classes and interfaces.

  • The ability to learn other core classes and interfaces as needed.

  • The ability to create your own classes and interfaces, when the supplied ones don't address your needs.

The last item implies that you should use existing code wherever possible. This approach has several powerful benefits:

  • The code in the core packages has been thoroughly tested.

  • The code in the core packages is available immediately.

  • The code in the core packages was developed at somebody else's cost (both time and money).

These benefits are offset by the principle that using an existing class to achieve an inappropriate result is generally more expensive than developing appropriate code from scratch. So a good rule of thumb is: Use core code when you can, and develop when you must.




Ground-Up Java
Ground-Up Java
ISBN: 0782141900
EAN: 2147483647
Year: 2005
Pages: 157
Authors: Philip Heller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net