简介
Written for programmers, this book provides an overview of the Java 2 platform and its libraries, as well as an introduction to current enterprise and server-side programming techniques. A companion CD- ROM contains the sample programs developed in each chapter, detailed code examples, Perl and Python language kits, GNU C/C++, Windows utility programs, games, and the answers to common programming questions. Van der Linden is a software engineer. Annotation c. Book News, Inc., Portland, OR (booknews.com)
目录
Acknowledgments p. xxix
Using the Just Java CD-ROM p. xxxi
About the CD-ROM p. xxxi
Language
What Is Java? p. 3
Compiling and Executing a Sample Program p. 5
The Biggest Java Benefit: Future-Proofing p. 9
Java Virtual Machine p. 14
The "Java Platform" p. 15
The Java Language p. 16
Java Libraries p. 18
Three Execution Environments p. 23
Some Light Relief--A Java Desktop Application p. 25
The Story of O: Object-Oriented Programming p. 27
Abstraction p. 30
Encapsulation p. 31
Comparing Primitive Types to Class Types p. 32
The One-Minute Object Manager p. 37
Creating New Objects: Constructors p. 39
Per-Instance and Per-Class Members p. 52
The "final" Modifier p. 57
Access Modifiers p. 59
Exercises p. 61
Some Light Relief--It's Not Your Father's IBM p. 62
Explanation of a Sample Program p. 65
Explanation of the Example Program p. 67
Where an Application Starts p. 70
Runtime Internals: Stack and Heap p. 72
The Class "Object" p. 75
Reading the Java API p. 79
Some Light Relief--Napster and LimeWire p. 82
Identifiers, Keywords, and Types p. 85
Java and Unicode p. 86
Scanning p. 88
Identifiers p. 89
Comments p. 90
Keywords p. 92
The Primitive Types p. 94
String Concatenation p. 107
String Comparison and intern p. 108
Some Light Relief--Hatless Atlas p. 111
Names, Arrays, Operators, and Accuracy p. 113
Names p. 114
Expressions p. 116
Arrays p. 117
Operators p. 126
Associativity p. 133
How Accurate Are Calculations? p. 134
Widening and Narrowing Conversions p. 137
What Happens on Overflow? p. 139
The Math Package p. 141
Further Reading p. 143
Some Light Relief--Too Much Bread p. 144
More OOP--Extending Classes p. 147
Inheritance p. 149
Polymorphism p. 161
The Class Whose Name Is Class p. 170
Exercises p. 173
Some Light Relief--The Nerd Detection System p. 174
Java Statements p. 175
"Organizing" Statements p. 177
Expression Statements p. 178
Selection Statements p. 179
Iteration Statements p. 181
Transfer of Control Statements p. 185
Exceptions p. 187
The Assert Statement p. 198
Further Reading p. 203
Exercises p. 203
Some Light Relief--MiniScribe: The Hard Luck Hard Disk p. 204
Interfaces p. 207
What Problem Does an Interface Solve? p. 208
Comparable p. 212
What Protected Really Means p. 218
Call Backs p. 221
Exercises p. 225
Some Light Relief--The Odyssey of Naming Hal p. 226
Packages and Visibility p. 227
What Are Packages For? p. 229
How the JVM Finds Classes p. 232
Packages and Access Modifiers p. 234
Compilation Units p. 239
Nested Classes p. 244
The Class Character p. 252
Exercises p. 255
Some Light Relief--The Domestic Obfuscated Java Code NonCompetition p. 256
Doing Several Things at Once: Threads p. 259
What Are Threads? p. 260
Two Ways to Obtain a New Thread p. 262
The Lifecycle of a Thread p. 267
Thread Groups p. 269
Four Kinds of Threads Programming p. 271
Some Light Relief--The Motion Sensor Solution p. 278
Advanced Thread Topics p. 281
More Thread Programming p. 282
Piped I/O for Threads p. 297
Garbage Collection p. 302
Design Patterns p. 307
Further Reading p. 308
Exercises p. 308
Some Light Relief--Are You Certifiable? p. 309
Practical Example Explained p. 313
Case Study Java Program: Fritter Engine Shunt p. 314
Exercises p. 325
Some Light Relief--Apple Armchair Advice p. 326
Key Libraries
Simple Input Output p. 333
Design Philosophy p. 336
File and FileDescriptor Classes p. 337
Output p. 342
Outputting Double-byte Characters p. 346
Other Writer Wrappers p. 350
Outputting ASCII Characters and Binary Values p. 353
Input p. 363
Reader Wrappers p. 366
Inputting ASCII Characters and Binary Values p. 367
Input Stream Wrappers p. 373
Further Reading p. 377
Exercises p. 378
Some Light Relief--The Illegal Prime Number! p. 379
Advanced Input Output p. 385
Random Access File p. 386
Reading from the Keyboard p. 389
Running Commands and Getting Output from Them p. 392
Formatted String Output p. 396
Writing Objects to Disk p. 400
New I/O Package p. 404
Memory Mapped I/O p. 414
File Locking p. 417
Charsets and Endian-ness p. 419
Exercises p. 426
Some Light Relief--The Illegal T-Shirt! p. 427
Regular Expressions, Collections, Utilities p. 437
Regular Expressions and Pattern Matching p. 438
Collections API p. 452
Other Utility Classes p. 488
The java.math API p. 490
Calendar Utilities p. 492
Other Utilities p. 498
Further Reading p. 504
Exercises p. 504
Some Light Relief--Exchanging Apples and Crays p. 506
Server-side Java
Servlets and JSP p. 509
Why Use Servlets? p. 513
Releases and Versions p. 515
Installing the Tomcat Software p. 517
Running the Example Servlets p. 519
Ports and Protocols p. 522
The HTML to Invoke a Servlet p. 524
A Servlet and Its Request/response p. 528
Servlet Request p. 530
Response to a Servlet Request p. 532
Writing Your Own Servlet p. 533
Servlet Operating Cycle and Threading p. 538
Java Server Pages p. 542
Java Beans in Servlets and JSP p. 547
Further Reading p. 548
Exercises p. 549
Some Light Relief--The Java-Powered Toaster p. 550
Networking in Java p. 555
Everything You Need To Know about TCP/IP but Failed to Learn in Kindergarten p. 556
A Client Socket in Java p. 567
Sending Email by Java p. 570
A Server Socket in Java p. 573
HTTP and Web Browsing: Retrieving HTTP Pages p. 584
How to Make an Applet Write a File on the Server p. 590
A Multithreaded HTTP Server p. 592
A Mapped I/O HTTP Server p. 594
Further Reading p. 596
Exercises p. 597
Some Light Relief--Using Java to Stuff an Online Poll p. 598
Remote Method Invocation p. 603
Object Serialization p. 605
Remote Method Invocation p. 607
Object Communication Middleware p. 619
Exercises p. 621
Some Light Relief--The Origami Kamikaze Water Bomber p. 622
Client Java
GUI Basics and Event-Handling p. 627
All About Event-Handling p. 629
Tips for Slimming Down Handler Code p. 637
Summary of Event-Handling p. 642
Exercises p. 646
Some Light Relief--The Mouse That Roared p. 647
All About Applets p. 651
Embedding a Java Program in a Web Page p. 654
Starting Applet Execution p. 656
Zip Files and Jar Files p. 665
Java Web Start p. 670
HTML Applet Tags p. 671
Exercises p. 673
Some Light Relief--Three Fine Applets p. 674
JFC and the Swing Package p. 677
Java Foundation Classes p. 678
All About Controls (JComponents) p. 683
Swing Threads--A Caution! p. 687
Swing Components p. 689
More about Swing Components p. 705
Further Reading p. 707
Exercises p. 707
Some Light Relief--The Bible Code p. 708
Containers, Layouts, and AWT Loose Ends p. 711
Pluggable Look and Feel p. 712
All About Containers p. 715
Layout in a Container p. 724
Tying up the Loose Ends p. 734
Exercises p. 742
Some Light Relief--Sky View Cafe: A High Quality Applet p. 743
Enterprise Java
Java Beans in Theory p. 749
What Is Component Software? p. 751
What Is a Java Bean? p. 754
Coding Time, Design Time, Runtime p. 757
Refresher on Events p. 759
Bean Conventions p. 762
Install the Beanbox p. 764
Run a Demo Bean p. 766
Customizing Bean Properties p. 769
Connecting a Button to a Method in Another Bean p. 770
Activation Framework and Infobus p. 775
Limitations of Beans p. 777
Enterprise Java Beans (EJB) p. 778
Using EJB in an Application Server p. 780
EJB Summary p. 782
Further Reading p. 782
Exercises p. 783
Some Light Relief--Furby's Brain Transplant p. 784
Java Beans in Practice p. 787
The Specification for Two Beans p. 788
The Code for the ConverterField Bean p. 790
The Code for DoltButton Bean p. 794
Compile, Jar, and Load Classes into Beanbox p. 796
Bean Icons p. 798
The Bean Info Class p. 800
Descriptor Classes p. 803
Properties p. 806
Bound Properties p. 809
Property Change Support for Non-Visual Beans p. 815
Summary: Telling Another Bean About a Change in One of Your Values p. 816
Connecting a Swing Event to a Method in Another Bean p. 818
Hidden State p. 820
The Completed, Integrated Rate Calculator p. 821
Customizing More Complicated Properties p. 823
Constrained Properties p. 824
Calling a Method in Another Bean--Don't Do It! p. 827
Exercises p. 829
Some Light Relief--Java's Duke Mascot p. 830
Complete Code Listings p. 831
Java Security p. 837
The Sandbox p. 842
Code Signing p. 843
The Security Manager p. 847
Applying the Security Policy p. 854
Signing a Java Program p. 858
Some Light Relief--Software About Nothing p. 867
Further References p. 869
Relational Databases and SQL p. 871
Introduction to Relational Databases p. 873
Primary and Foreign Keys p. 877
1-Many, Many-Many Relationships p. 879
Normal Forms p. 882
Relational Database Glossary p. 883
Basic SQL Primer p. 885
Creating and Populating Tables p. 887
Querying and Retrieving Data p. 890
Subquery Selections p. 894
Result Set of a Select Query p. 895
Updating Values p. 896
Deleting Records and Tables p. 897
SQL Prepared Statements and Stored Procedures p. 898
Further Reading p. 899
Exercises p. 900
Some Light Relief--Reading the Docs p. 901
JDBC p. 903
Downloading and Installing the Software p. 905
Running the Example Code p. 909
Connecting to the Database p. 911
Executing SQL Statements p. 915
Result Sets p. 919
Batching SQL Statements and Transactions p. 922
Prepared Statements and Stored Procedures p. 924
Complete Example p. 926
Database and Result Set Metadata p. 929
Further Reading p. 930
Exercises p. 930
Light Relief--Hear Java Speak! See Java on a PDA! p. 931
XML and Java p. 933
Some Rules of XML p. 937
The Document Type Definition (DTD) p. 939
What Is XML Used For? p. 943
XML Versions and Glossary p. 945
JAXP Library Contents p. 947
Reading XML with DOM Parsers p. 948
A Program That Uses a DOM Parser p. 949
Reading an XML File--SAX Parsers p. 957
A Program That Uses a SAX Parser p. 959
The Factory Design Pattern p. 963
Design Pattern Summary p. 967
Other Java XML Notes p. 969
Download and Install the Java XML Software (JAXP) p. 970
Running the Example Code p. 972
Further Reading p. 973
Exercises p. 974
Some Light Relief--"View Source" on Kevin's Life p. 975
Graphics Programming p. 979
Colors p. 981
Fonts and Font Metrics p. 985
The Graphics Context p. 988
Drawing Text, Lines, and Shapes p. 989
Loading and Drawing Images p. 995
Sounds p. 1026
Some Light Relief--Satan: Oscillate My Metallic Sonatas p. 1033
Obsolete Components of the Abstract Window Toolkit p. 1035
How the Java Abstract Window Toolkit Works p. 1036
Controls, Containers, Events p. 1037
All About AWT Controls (Components) p. 1039
All About Containers p. 1065
Powers of 2 and ISO 8859 p. 1079
Index p. 1082
Using the Just Java CD-ROM p. xxxi
About the CD-ROM p. xxxi
Language
What Is Java? p. 3
Compiling and Executing a Sample Program p. 5
The Biggest Java Benefit: Future-Proofing p. 9
Java Virtual Machine p. 14
The "Java Platform" p. 15
The Java Language p. 16
Java Libraries p. 18
Three Execution Environments p. 23
Some Light Relief--A Java Desktop Application p. 25
The Story of O: Object-Oriented Programming p. 27
Abstraction p. 30
Encapsulation p. 31
Comparing Primitive Types to Class Types p. 32
The One-Minute Object Manager p. 37
Creating New Objects: Constructors p. 39
Per-Instance and Per-Class Members p. 52
The "final" Modifier p. 57
Access Modifiers p. 59
Exercises p. 61
Some Light Relief--It's Not Your Father's IBM p. 62
Explanation of a Sample Program p. 65
Explanation of the Example Program p. 67
Where an Application Starts p. 70
Runtime Internals: Stack and Heap p. 72
The Class "Object" p. 75
Reading the Java API p. 79
Some Light Relief--Napster and LimeWire p. 82
Identifiers, Keywords, and Types p. 85
Java and Unicode p. 86
Scanning p. 88
Identifiers p. 89
Comments p. 90
Keywords p. 92
The Primitive Types p. 94
String Concatenation p. 107
String Comparison and intern p. 108
Some Light Relief--Hatless Atlas p. 111
Names, Arrays, Operators, and Accuracy p. 113
Names p. 114
Expressions p. 116
Arrays p. 117
Operators p. 126
Associativity p. 133
How Accurate Are Calculations? p. 134
Widening and Narrowing Conversions p. 137
What Happens on Overflow? p. 139
The Math Package p. 141
Further Reading p. 143
Some Light Relief--Too Much Bread p. 144
More OOP--Extending Classes p. 147
Inheritance p. 149
Polymorphism p. 161
The Class Whose Name Is Class p. 170
Exercises p. 173
Some Light Relief--The Nerd Detection System p. 174
Java Statements p. 175
"Organizing" Statements p. 177
Expression Statements p. 178
Selection Statements p. 179
Iteration Statements p. 181
Transfer of Control Statements p. 185
Exceptions p. 187
The Assert Statement p. 198
Further Reading p. 203
Exercises p. 203
Some Light Relief--MiniScribe: The Hard Luck Hard Disk p. 204
Interfaces p. 207
What Problem Does an Interface Solve? p. 208
Comparable p. 212
What Protected Really Means p. 218
Call Backs p. 221
Exercises p. 225
Some Light Relief--The Odyssey of Naming Hal p. 226
Packages and Visibility p. 227
What Are Packages For? p. 229
How the JVM Finds Classes p. 232
Packages and Access Modifiers p. 234
Compilation Units p. 239
Nested Classes p. 244
The Class Character p. 252
Exercises p. 255
Some Light Relief--The Domestic Obfuscated Java Code NonCompetition p. 256
Doing Several Things at Once: Threads p. 259
What Are Threads? p. 260
Two Ways to Obtain a New Thread p. 262
The Lifecycle of a Thread p. 267
Thread Groups p. 269
Four Kinds of Threads Programming p. 271
Some Light Relief--The Motion Sensor Solution p. 278
Advanced Thread Topics p. 281
More Thread Programming p. 282
Piped I/O for Threads p. 297
Garbage Collection p. 302
Design Patterns p. 307
Further Reading p. 308
Exercises p. 308
Some Light Relief--Are You Certifiable? p. 309
Practical Example Explained p. 313
Case Study Java Program: Fritter Engine Shunt p. 314
Exercises p. 325
Some Light Relief--Apple Armchair Advice p. 326
Key Libraries
Simple Input Output p. 333
Design Philosophy p. 336
File and FileDescriptor Classes p. 337
Output p. 342
Outputting Double-byte Characters p. 346
Other Writer Wrappers p. 350
Outputting ASCII Characters and Binary Values p. 353
Input p. 363
Reader Wrappers p. 366
Inputting ASCII Characters and Binary Values p. 367
Input Stream Wrappers p. 373
Further Reading p. 377
Exercises p. 378
Some Light Relief--The Illegal Prime Number! p. 379
Advanced Input Output p. 385
Random Access File p. 386
Reading from the Keyboard p. 389
Running Commands and Getting Output from Them p. 392
Formatted String Output p. 396
Writing Objects to Disk p. 400
New I/O Package p. 404
Memory Mapped I/O p. 414
File Locking p. 417
Charsets and Endian-ness p. 419
Exercises p. 426
Some Light Relief--The Illegal T-Shirt! p. 427
Regular Expressions, Collections, Utilities p. 437
Regular Expressions and Pattern Matching p. 438
Collections API p. 452
Other Utility Classes p. 488
The java.math API p. 490
Calendar Utilities p. 492
Other Utilities p. 498
Further Reading p. 504
Exercises p. 504
Some Light Relief--Exchanging Apples and Crays p. 506
Server-side Java
Servlets and JSP p. 509
Why Use Servlets? p. 513
Releases and Versions p. 515
Installing the Tomcat Software p. 517
Running the Example Servlets p. 519
Ports and Protocols p. 522
The HTML to Invoke a Servlet p. 524
A Servlet and Its Request/response p. 528
Servlet Request p. 530
Response to a Servlet Request p. 532
Writing Your Own Servlet p. 533
Servlet Operating Cycle and Threading p. 538
Java Server Pages p. 542
Java Beans in Servlets and JSP p. 547
Further Reading p. 548
Exercises p. 549
Some Light Relief--The Java-Powered Toaster p. 550
Networking in Java p. 555
Everything You Need To Know about TCP/IP but Failed to Learn in Kindergarten p. 556
A Client Socket in Java p. 567
Sending Email by Java p. 570
A Server Socket in Java p. 573
HTTP and Web Browsing: Retrieving HTTP Pages p. 584
How to Make an Applet Write a File on the Server p. 590
A Multithreaded HTTP Server p. 592
A Mapped I/O HTTP Server p. 594
Further Reading p. 596
Exercises p. 597
Some Light Relief--Using Java to Stuff an Online Poll p. 598
Remote Method Invocation p. 603
Object Serialization p. 605
Remote Method Invocation p. 607
Object Communication Middleware p. 619
Exercises p. 621
Some Light Relief--The Origami Kamikaze Water Bomber p. 622
Client Java
GUI Basics and Event-Handling p. 627
All About Event-Handling p. 629
Tips for Slimming Down Handler Code p. 637
Summary of Event-Handling p. 642
Exercises p. 646
Some Light Relief--The Mouse That Roared p. 647
All About Applets p. 651
Embedding a Java Program in a Web Page p. 654
Starting Applet Execution p. 656
Zip Files and Jar Files p. 665
Java Web Start p. 670
HTML Applet Tags p. 671
Exercises p. 673
Some Light Relief--Three Fine Applets p. 674
JFC and the Swing Package p. 677
Java Foundation Classes p. 678
All About Controls (JComponents) p. 683
Swing Threads--A Caution! p. 687
Swing Components p. 689
More about Swing Components p. 705
Further Reading p. 707
Exercises p. 707
Some Light Relief--The Bible Code p. 708
Containers, Layouts, and AWT Loose Ends p. 711
Pluggable Look and Feel p. 712
All About Containers p. 715
Layout in a Container p. 724
Tying up the Loose Ends p. 734
Exercises p. 742
Some Light Relief--Sky View Cafe: A High Quality Applet p. 743
Enterprise Java
Java Beans in Theory p. 749
What Is Component Software? p. 751
What Is a Java Bean? p. 754
Coding Time, Design Time, Runtime p. 757
Refresher on Events p. 759
Bean Conventions p. 762
Install the Beanbox p. 764
Run a Demo Bean p. 766
Customizing Bean Properties p. 769
Connecting a Button to a Method in Another Bean p. 770
Activation Framework and Infobus p. 775
Limitations of Beans p. 777
Enterprise Java Beans (EJB) p. 778
Using EJB in an Application Server p. 780
EJB Summary p. 782
Further Reading p. 782
Exercises p. 783
Some Light Relief--Furby's Brain Transplant p. 784
Java Beans in Practice p. 787
The Specification for Two Beans p. 788
The Code for the ConverterField Bean p. 790
The Code for DoltButton Bean p. 794
Compile, Jar, and Load Classes into Beanbox p. 796
Bean Icons p. 798
The Bean Info Class p. 800
Descriptor Classes p. 803
Properties p. 806
Bound Properties p. 809
Property Change Support for Non-Visual Beans p. 815
Summary: Telling Another Bean About a Change in One of Your Values p. 816
Connecting a Swing Event to a Method in Another Bean p. 818
Hidden State p. 820
The Completed, Integrated Rate Calculator p. 821
Customizing More Complicated Properties p. 823
Constrained Properties p. 824
Calling a Method in Another Bean--Don't Do It! p. 827
Exercises p. 829
Some Light Relief--Java's Duke Mascot p. 830
Complete Code Listings p. 831
Java Security p. 837
The Sandbox p. 842
Code Signing p. 843
The Security Manager p. 847
Applying the Security Policy p. 854
Signing a Java Program p. 858
Some Light Relief--Software About Nothing p. 867
Further References p. 869
Relational Databases and SQL p. 871
Introduction to Relational Databases p. 873
Primary and Foreign Keys p. 877
1-Many, Many-Many Relationships p. 879
Normal Forms p. 882
Relational Database Glossary p. 883
Basic SQL Primer p. 885
Creating and Populating Tables p. 887
Querying and Retrieving Data p. 890
Subquery Selections p. 894
Result Set of a Select Query p. 895
Updating Values p. 896
Deleting Records and Tables p. 897
SQL Prepared Statements and Stored Procedures p. 898
Further Reading p. 899
Exercises p. 900
Some Light Relief--Reading the Docs p. 901
JDBC p. 903
Downloading and Installing the Software p. 905
Running the Example Code p. 909
Connecting to the Database p. 911
Executing SQL Statements p. 915
Result Sets p. 919
Batching SQL Statements and Transactions p. 922
Prepared Statements and Stored Procedures p. 924
Complete Example p. 926
Database and Result Set Metadata p. 929
Further Reading p. 930
Exercises p. 930
Light Relief--Hear Java Speak! See Java on a PDA! p. 931
XML and Java p. 933
Some Rules of XML p. 937
The Document Type Definition (DTD) p. 939
What Is XML Used For? p. 943
XML Versions and Glossary p. 945
JAXP Library Contents p. 947
Reading XML with DOM Parsers p. 948
A Program That Uses a DOM Parser p. 949
Reading an XML File--SAX Parsers p. 957
A Program That Uses a SAX Parser p. 959
The Factory Design Pattern p. 963
Design Pattern Summary p. 967
Other Java XML Notes p. 969
Download and Install the Java XML Software (JAXP) p. 970
Running the Example Code p. 972
Further Reading p. 973
Exercises p. 974
Some Light Relief--"View Source" on Kevin's Life p. 975
Graphics Programming p. 979
Colors p. 981
Fonts and Font Metrics p. 985
The Graphics Context p. 988
Drawing Text, Lines, and Shapes p. 989
Loading and Drawing Images p. 995
Sounds p. 1026
Some Light Relief--Satan: Oscillate My Metallic Sonatas p. 1033
Obsolete Components of the Abstract Window Toolkit p. 1035
How the Java Abstract Window Toolkit Works p. 1036
Controls, Containers, Events p. 1037
All About AWT Controls (Components) p. 1039
All About Containers p. 1065
Powers of 2 and ISO 8859 p. 1079
Index p. 1082
- 名称
- 类型
- 大小
光盘服务联系方式: 020-38250260 客服QQ:4006604884
云图客服:
用户发送的提问,这种方式就需要有位在线客服来回答用户的问题,这种 就属于对话式的,问题是这种提问是否需要用户登录才能提问
Video Player
×
Audio Player
×
pdf Player
×
亲爱的云图用户,
光盘内的文件都可以直接点击浏览哦
无需下载,在线查阅资料!