PDF Ebook Core Java™ 2: Volume I–Fundamentals
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.)
Contents
List of Tables, Code Examples and Figures
- Tables
Code Examples
Figures
Preface
- To the Reader
About This Book
Conventions
CD-ROM
Acknowledgments
Chapter 1. An Introduction to Java
- Java as a Programming Tool
Advantages of Java
The Java “White Paper” Buzzwords
Java and the Internet
A Short History of Java
Common Misconceptions About Java
Chapter 2. The Java Programming Environment
- Installing the Java Software Development Kit
Development Environments
Using the Command Line Tools
Using an Integrated Development Environment
Compiling and Running Programs from a Text Editor
Graphical Applications
Applets
Chapter 3. Fundamental Programming Structures in Java
- A Simple Java Program
Comments
Data Types
Variables
Assignments and Initializations
Operators
Strings
Control Flow
Big Numbers
Arrays
Chapter 4. Objects and Classes
- Introduction to Object-Oriented Programming
Using Existing Classes
Building Your Own Classes
Static Fields and Methods
Method Parameters
Object Construction
Packages
Documentation Comments
Class Design Hints
Chapter 5. Inheritance
- Extending Classes
Object:
The Cosmic Superclass
The
Class
Class
Reflection
Design Hints for Inheritance
Chapter 6. Interfaces and Inner Classes
- Interfaces
Object Cloning
Inner Classes
Proxies
Chapter 7. Graphics Programming
- Introduction to Swing
Creating a Frame
Frame Positioning
Displaying Information in a Panel
2D Shapes
Colors
Text and Fonts
Images
Chapter 8. Event Handling
- Basics of Event Handling
The AWT Event Hierarchy
Semantic and Low-Level Events in the AWT
Low-Level Event Types
Actions
Multicasting
The Event Queue
Chapter 9. User Interface Components with Swing
- The Model-View-Controller Design Pattern
An Introduction to Layout Management
Text Input
Making Choices
Menus
Sophisticated Layout Management
Dialog Boxes
Chapter 10. Applets
- Applet Basics
The Applet HTML Tags and Attributes
Multimedia
The Applet Context
JAR Files
Chapter 11. Exceptions and Debugging
- Dealing with Errors
Catching Exceptions
Some Tips on Using Exceptions
Debugging Techniques
Using a Debugger
Chapter 12. Streams and Files
- Streams
The Complete Stream Zoo
ZIP File Streams
Putting Streams to Use
Object Streams
File Management
Appendix Java Keywords
Posted in :