Essentials of the Java Programming Language - Monica Pawlan - Librairie Eyrolles
Tous nos rayons

Déjà client ? Identifiez-vous

Mot de passe oublié ?

Nouveau client ?

CRÉER VOTRE COMPTE
Essentials of the Java Programming Language
Ajouter à une liste

Librairie Eyrolles - Paris 5e
Indisponible

Essentials of the Java Programming Language

Essentials of the Java Programming Language

A Hands-On Guide

Monica Pawlan

320 pages, parution le 22/04/2000

Résumé

If you are interested in learning the Java programming language but hesitate to dive into overly dense, theoretical resources, Essentials of the Java Programming Language is the perfect starting point. This accessible, hands-on tutorial employs a "learn-by-doing" approach to introduce you to the basics. It starts with a simple program, then develops it bit by bit, adding new features and explaining important concepts with each subsequent lesson. This simple program grows into a general electronic commerce application that illustrates many of the Java 2 platform's most important elements.

You will learn such Java programming language essentials as:

  • The difference between applications, applets, and servlets/JavaServer Pages
  • Building a user interface that accepts user input
  • Reading and writing data to files and databases
  • Network communications, including RMI and sockets
  • Collections
  • Serialization
  • Packages and JAR file format
  • Internationalization
  • Security fundamentals, including cryptographic software
Essentials of the Java Programming Language ends with an explanation of object-oriented programming concepts, made far more understandable and relevant as a result of the hands-on experience acquired throughout the book. After working through this book, you will have the foundation necessary to comfortably progress to more advanced learning materials for the Java programming language and utilize the subtleties and more sophisticated capabilities of the language.

Table of contents

Preface xi
Acknowledgments xii

LESSON 1

Compiling and Running a Simple Program 1
Covered in This Lesson 1
A Word About the Java Platform 2
Setting Up Your Computer 3
Writing a Program 3
Compiling the Program 3
Interpreting and Running the Program 4
Code Comments 5
Double Slashes 5
C-Style Comments 5
Doc Comments 5
API Documentation 6
Setting the CLASSPATH Environment Variable on a Windows Platform 6
Exercises 6
More Information 7

LESSON 2

Building Applications 9
Covered in This Lesson 9
Application Structure and Elements 9
Fields and Methods 12
Constructors 14
To Summarize 16
Exercises 16
More Information 16

LESSON 3

Building Applets 17
Covered in This Lesson 17
Application to Applet 18
Run the Applet 19
Applet Structure and Elements 19
Extending a Class 20
Behavior 21
Appearance 22
Packages 23
Exercises 24
More Information 24

LESSON 4

Building a User Interface 25
Covered in This Lesson 25
Project Swing APIs 26
Import Statements 27
Class Declaration 28
Instance Variables 29
Constructor 29
Action Listening 31
Event Handling 31
Main Method 32
Exercises: Applets Revisited 33
Summary 34
More Information 35

LESSON 5

Building Servlets 37
Covered in This Lesson 37
About the Example 38
HTML Form 39
Servlet Code 40
Class and Method Declarations 41
Method Implementation 42
JavaServer Pages 43
HTML Form 43
JavaServer Page 44
Exercises 45
More Information 45

LESSON 6

File Access and Permissions 47
Covered in This Lesson 47
File Access by Applications 48
Constructor and Instance Variable Changes 49
Method Changes 49
System Properties 51
File.separatorChar 52
Exception Handling 52
File Access by Applets 54
Granting Applets Permission 55
Creating a Policy File 56
Running an Applet with a Policy File 56
Restricting Applications 57
File Access by Servlets 57
Exercises 59
More Information 59
Code for This Lesson 60
FileIO Program 60
FileIOAppl Program 62
FileIOServlet Program 63
AppendIO Program 64

LESSON 7

Database Access and Permissions 67
Covered in This Lesson 67
Database Setup 68
Create Database Table 68
Database Access by Applications 69
Establishing a Database Connection 70
Final and Private Variables 71
Writing and Reading Data 71
Database Access by Applets 72
JDBC Driver 72
JDBC-ODBC Bridge with ODBC Driver 74
Database Access by Servlets 76
Exercises 76
More Information 77
Code for This Lesson 77
Dba Program 77
DbaAppl Program 79
DbaOdbAppl Program 81
DbaServlet Program 83

LESSON 8

Remote Method Invocation 85
Covered in This Lesson 86
About the Example 86
Program Behavior 86
File Summary 88
Compile the Example 89
Start the RMI Registry 91
Start the Server 91
Run the RMIClient1 Program 92
Run the RMIClient2 Program 93
RemoteServer Class 94
Send Interface 95
RMIClient1 Class 95
actionPerformed Method 95
main Method 96
RMIClient2 Class 96
actionPerformed Method 96
main Method 97
Exercises 97
More Information 98
Code for This Lesson 98
RMIClient1 Program 98
RMIClient2 Program 99
RemoteServer Program 101
Send Interface 101

LESSON 9

Socket Communications 103
Covered in This Lesson 103
What are Sockets and Threads? 104
About the Examples 104
Example 1: Client-Side Behavior 105
Example 1: Server-Side Behavior 105
Example 1: Compile and Run 106
Example 1: Server-Side Program 106
listenSocket Method 106
actionPerformed Method 107
Example 1: Client-Side Program 108
listenSocket Method 108
actionPerformed Method 108
Example 2: Multithreaded Server Example 109
Exercises 112
More Information 112
Code for This Lesson 112
SocketClient Program 112
SocketServer Program 114
SocketThrdServer Program 116

LESSON 10

User Interfaces Revisited 119
Covered in This Lesson 119
About the Example 120
Fruit Order Client (RMIClient1) 120
Server Program 121
View Order Client (RMIClient2) 121
Compile and Run the Example 122
Fruit Order (RMIClient1) Code 125
Instance Variables 126
Constructor 126
Event Handling 128
Cursor Focus 130
Converting Strings to Numbers and Back 130
Server Program Code 132
Send Interface 132
RemoteServer Class 133
View Order Client (RMIClient2) Code 134
Exercises 135
Calculations and Pressing Return 135
Non-Number Errors 135
Extra Credit 135
More Information 136
Code for This Lesson 136
RMIClient1 Program 136
RMIClient2 Program 140
RMIClient1 Improved Program 143

LESSON 11

Developing the Example 149
Covered in This Lesson 149
Tracking Orders 150
sendOrder Method 150
getOrder Method 150
Other Changes to Server Code 151
Maintaining and Displaying a Customer List 153
About Collections 153
Creating a Set 154
Accessing Data in a Set 155
Displaying Data in a Dialog Box 156
Exercises 157
More Information 158
Code for This Lesson 158
RemoteServer Program 158
RMIClient2 160

LESSON 12

Internationalization 165
Covered in This Lesson 165
Identify Culturally Dependent Data 166
Create Keyword and Value Pair Files 168
German Translations 170
French Translations 171
Internationalize Application Text 172
Instance Variables 172
main Method 172
Constructor 174
actionPerformed Method 175
Internationalize Numbers 175
Compile and Run the Application 176
Compile 176
Start the RMI Registry 176
Start the Server 177
Start the RMIClient1 Program in German 177
Start the RMIClient2 Program in French 177
Exercises 178
More Information 179
Code for This Lesson 180
RMIClient1 180
RMIClient2 184

LESSON 13

Packages and JAR File Format 189
Covered in This Lesson 189
Setting up Class Packages 190
Create the Directories 190
Declare the Packages 191
Make Classes and Fields Accessible 191
Change Client Code to Find the Properties Files 192
Compile and Run the Example 192
Compile 192
Start the RMI Registry 193
Start the Server 193
Start the RMIGermanApp Program 194
Start the RMIClient2 Program in French 194
Using JAR Files to Deploy 195
Server Set of Files 195
Fruit Order Set of Files (RMIClient1) 196
View Order Set of Files 198
Exercises 198
More Information 198

LESSON 14

Object-Oriented Programming 199
Covered in This Lesson 199
Object-Oriented Programming 200
Classes 200
Objects 201
Well-Defined Boundaries and Cooperation 202
Inheritance and Polymorphism 203
Data Access Levels 205
Classes 205
Fields and Methods 206
Global Variables and Methods 206
Your Own Classes 207
Well-Defined Boundaries and Cooperation 207
Inheritance 207
Access Levels 208
Exercises 208
More Information 209

APPENDIX A

Cryptography 211
Covered in This Lesson 211
About the Example 212
Compiling and Running the Example 214
Source Code 214
Sealing the Symmetric Key 215
Encrypting the Symmetric Key with the RSA Algorithm 222
Exercises 229
More Information 229

APPENDIX B

Code Listings 231
Covered in This Lesson 231
Application Code 231
Application Code:
RMIClient1 232
Application Code:
RMIClient2 236
Application Code:
DataOrder 241
Application Code:
Send 241
Application Code:
RemoteServer 241
Application Code:
RMIFrenchApp 243
Application Code:
RMIGermanApp 247
Application Code:
RMIEnglishApp 251
Cryptography Example 254
Sealing the Symmetric Key
RMIClient1 Program 255
Sealing the Symmetric Key
RMIClient2 Program 260
Encrypting the Symmetric Key with the RSA Algorithm
RMIClient1 Program 265
Encrypting the Symmetric Key with the RSA Algorithm
RMIClient2 Program 271

Index 277

Caractéristiques techniques

  PAPIER
Éditeur(s) Addison Wesley
Auteur(s) Monica Pawlan
Parution 22/04/2000
Nb. de pages 320
Format 18,7 x 23,5
Couverture Broché
Poids 488g
Intérieur Noir et Blanc
EAN13 9780201707205

Avantages Eyrolles.com

Livraison à partir de 0,01 en France métropolitaine
Paiement en ligne SÉCURISÉ
Livraison dans le monde
Retour sous 15 jours
+ d'un million et demi de livres disponibles
satisfait ou remboursé
Satisfait ou remboursé
Paiement sécurisé
modes de paiement
Paiement à l'expédition
partout dans le monde
Livraison partout dans le monde
Service clients sav@commande.eyrolles.com
librairie française
Librairie française depuis 1925
Recevez nos newsletters
Vous serez régulièrement informé(e) de toutes nos actualités.
Inscription