rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780131735798

Java For Students

by ;
  • ISBN13:

    9780131735798

  • ISBN10:

    0131735799

  • Edition: 5th
  • Format: Paperback w/CD
  • Copyright: 2006-01-01
  • Publisher: Prentice Hall
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $115.00

Summary

This latest EDITION of Java for Students has been fully updated to include the new features of Java 5.0. The AUTHORs' GUI-based approach helps students to build their programming skills by producing exciting and dynamic graphical output. Hallmark features include: Oslash; A focus on applications and GUI development with Swing. Oslash; Graphics are used throughout to illustrate programming principles. Oslash; UML 2.0 is used for modelling and design. Oslash; A wealth of exercises and self-test questions with solutions. Oslash; A CD-ROM containing the JDK 1.5 and source code for all programs. Check out the companion website for the book at www.pearsoned.co.uk/bell to find additional resources for both students and instructors. About the AUTHORs Douglas Bell and Mike Parr have based the book on courses they teach at Sheffield Hallam University. They have also AUTHORed student texts on C# and VB .NET, and Douglas Bell is also the AUTHOR of Software Engineering for Students, now in its fourth EDITION.

Table of Contents

Introductionp. xviii
Guided tourp. xxiv
The background to Javap. 1
The history of Javap. 1
The main features of Javap. 2
What is a program?p. 3
Programming principlesp. 5
Programming pitfallsp. 5
Summaryp. 6
Exercisesp. 6
Answers to self-test questionsp. 7
First programsp. 8
Introductionp. 8
Integrated development environmentsp. 9
Files and foldersp. 9
Using an editorp. 10
Creating a first Java programp. 11
The librariesp. 13
Demystifying the programp. 14
Objects, methods: an introductionp. 15
Classes: an analogyp. 16
Using a text fieldp. 17
Programming principlesp. 19
Programming pitfallsp. 19
Grammar spotp. 20
New language elementsp. 20
Summaryp. 20
Exercisesp. 21
Answers to self-test questionsp. 21
Using graphics methodsp. 22
Introductionp. 22
Eventsp. 22
The button-click eventp. 24
The graphics coordinate systemp. 25
Explanation of the programp. 25
Methods for drawingp. 27
Drawing with coloursp. 28
Creating a new programp. 28
The sequence conceptp. 29
Adding meaning with commentsp. 31
Programming principlesp. 31
Programming pitfallsp. 32
Grammar spotp. 32
New language elementsp. 32
Summaryp. 32
Exercisesp. 32
Answers to self-test questionsp. 33
Variables and calculationsp. 35
Introductionp. 35
The nature of intp. 36
The nature of doublep. 36
Declaring variablesp. 37
The assignment statementp. 41
Calculations and operatorsp. 41
The arithmetic operatorsp. 42
The % operatorp. 45
Joining strings with the + operatorp. 46
Converting between strings and numbersp. 47
Message dialogs and input dialogsp. 49
Formatting text in dialogs with \np. 51
Converting between numbersp. 52
Constants: using finalp. 53
The role of expressionsp. 54
Programming principlesp. 55
Programming pitfallsp. 55
Grammar spotp. 56
New language elementsp. 56
Summaryp. 57
Exercisesp. 57
Answers to self-test questionsp. 59
Methods and parametersp. 60
Introductionp. 60
Writing your own methodsp. 61
A first methodp. 62
Calling a methodp. 64
Passing parametersp. 64
Formal and actual parametersp. 66
A triangle methodp. 67
Local variablesp. 70
Name clashesp. 71
Event-handling methods and mainp. 72
return and resultsp. 73
Building on methods: drawHousep. 76
Building on methods: areaHousep. 78
this and objectsp. 79
Overloadingp. 80
Programming principlesp. 81
Programming pitfallsp. 82
Grammar spotp. 82
New language elementsp. 83
Summaryp. 83
Exercisesp. 83
Answers to self-test questionsp. 86
Using objectsp. 88
Introductionp. 88
Instance variablesp. 89
Instantiation: using constructors with newp. 92
The Random classp. 92
The main method and newp. 97
The Swing toolkitp. 98
Eventsp. 98
Creating a JButtonp. 99
Guidelines for using objectsp. 101
The JLabel classp. 101
The JTextField classp. 103
The JPanel classp. 104
The Timer classp. 104
The JSlider classp. 106
The ImageIcon classp. 109
Programming principlesp. 111
Programming pitfallsp. 111
Grammar spotp. 112
New language elementsp. 112
Summaryp. 112
Exercisesp. 112
Answers to self-test questionsp. 114
Selectionp. 115
Introductionp. 115
The if statementp. 116
if...elsep. 118
Comparison operatorsp. 121
Multiple eventsp. 129
And, or, notp. 131
Nested ifsp. 134
switchp. 136
Boolean variablesp. 139
Comparing stringsp. 143
Programming principlesp. 143
Programming pitfallsp. 143
Grammar spotp. 145
New language elementsp. 146
Summaryp. 146
Exercisesp. 147
Answers to self-test questionsp. 149
Repetitionp. 152
Introductionp. 152
whilep. 153
forp. 158
And, or, notp. 159
do...whilep. 161
Nested loopsp. 163
Combining control structuresp. 164
Programming principlesp. 165
Programming pitfallsp. 165
Grammar spotp. 166
New language elementsp. 166
Summaryp. 167
Exercisesp. 167
Answers to self-test questionsp. 169
Writing classesp. 171
Introductionp. 171
Designing a classp. 172
Classes and filesp. 175
private variablesp. 177
public methodsp. 177
The get and set methodsp. 179
Constructorsp. 180
Multiple constructorsp. 181
private methodsp. 182
Scope rulesp. 184
Operations on objectsp. 185
Object destructionp. 186
static methodsp. 186
static variablesp. 187
Programming principlesp. 188
Programming pitfallsp. 189
Grammar spotp. 190
New language elementsp. 190
Summaryp. 191
Exercisesp. 191
Answers to self-test questionsp. 193
Inheritancep. 194
Introductionp. 194
Using inheritancep. 195
protectedp. 196
Scope rulesp. 197
Additional itemsp. 197
Overridingp. 198
Class diagramsp. 198
Inheritance at workp. 199
superp. 200
Constructorsp. 200
finalp. 203
Abstract classesp. 204
Programming principlesp. 205
Programming pitfallsp. 206
New language elementsp. 207
Summaryp. 207
Exercisesp. 208
Answers to self-test questionsp. 209
Calculationsp. 210
Introductionp. 210
Library mathematical functions and constantsp. 211
Formatting numbersp. 211
Case study - moneyp. 214
Case study - iterationp. 217
Graphsp. 218
Exceptionsp. 222
Programming principlesp. 223
Programming pitfallsp. 223
Summaryp. 223
Exercisesp. 224
Answer to self-test questionp. 227
Array listsp. 228
Introductionp. 228
Creating an array list and genericsp. 229
Adding items to a listp. 229
The length of a listp. 230
Indicesp. 231
Displaying an array listp. 231
The enhanced for statementp. 232
Using index valuesp. 233
Removing items from an array listp. 234
Inserting items within an array listp. 235
Lookupp. 235
Arithmetic on an array listp. 236
Searchingp. 238
Programming principlesp. 239
Programming pitfallsp. 240
New language elementsp. 240
Summaryp. 240
Exercisesp. 241
Answers to self-test questionsp. 241
Arraysp. 242
Introductionp. 242
Creating an arrayp. 244
Indicesp. 245
The length of an arrayp. 247
Passing arrays as parametersp. 247
The enhanced for statementp. 248
Using constantsp. 249
Initializing an arrayp. 250
A sample programp. 251
Lookupp. 253
Searchingp. 254
Arrays of objectsp. 256
Programming principlesp. 257
Programming pitfallsp. 258
Grammar spotp. 259
Summaryp. 259
Exercisesp. 259
Answers to self-test questionsp. 263
Arrays - two dimensionalp. 265
Introductionp. 265
Declaring an arrayp. 266
Indicesp. 267
The size of an arrayp. 268
Passing arrays as parametersp. 269
Constantsp. 269
Initializing an arrayp. 270
A sample programp. 271
Programming principlesp. 272
Programming pitfallsp. 273
Summaryp. 273
Exercisesp. 274
Answers to self-test questionsp. 277
String manipulationp. 278
Introductionp. 278
Using strings - a recapp. 279
The characters within stringsp. 280
A note on the char typep. 280
The String classp. 281
The String class methodsp. 281
Comparing stringsp. 283
Amending stringsp. 285
Examining stringsp. 286
String conversionsp. 289
String parametersp. 291
An example of string processingp. 291
String case study - Frasierp. 292
Programming principlesp. 296
Programming pitfallsp. 297
Grammar spotp. 297
New language elementsp. 297
Summaryp. 298
Exercisesp. 298
Answer to self-test questionp. 300
Exceptionsp. 301
Introductionp. 301
Exceptions and objectsp. 303
When to use exceptionsp. 304
The jargon of exceptionsp. 304
A try-catch examplep. 304
try and scopesp. 307
The search for a catcherp. 308
Throwing - an introductionp. 309
Exception classesp. 310
Compilation and checked exceptionsp. 310
Catching - the common casesp. 312
Using the exception class structurep. 314
Programming principlesp. 314
Programming pitfallsp. 315
Grammar spotp. 315
New language elementsp. 315
Summaryp. 316
Exercisesp. 316
Answers to self-test questionsp. 317
Files and console applicationsp. 318
Introductionp. 318
File access: stream or random?p. 319
The essentials of streamsp. 319
The Java I/O classesp. 320
The BufferedReader and PrintWriter classesp. 320
File outputp. 321
File inputp. 324
File searchingp. 327
The File classp. 331
The JFileChooser classp. 333
Console I/Op. 336
The System classp. 336
Using JOptionPanep. 338
A console example: Finderp. 338
Reading from a remote sitep. 340
Command-line argumentsp. 342
Programming principlesp. 344
Programming pitfallsp. 344
Grammar spotp. 344
New language elementsp. 344
Summaryp. 345
Exercisesp. 346
Answers to self-test questionsp. 347
Object-oriented designp. 348
Introductionp. 348
The design problemp. 349
Identifying objects and methodsp. 349
Case study in designp. 354
Looking for reusep. 360
Composition or inheritance?p. 361
Guidelines for class designp. 365
Summaryp. 366
Exercisesp. 367
Answers to self-test questionsp. 368
Program stylep. 369
Introductionp. 369
Program layoutp. 370
Namesp. 371
Classesp. 371
Commentsp. 372
Constantsp. 373
Methodsp. 374
Nested ifsp. 375
Nested loopsp. 378
Complex conditionsp. 379
Documentationp. 381
Consistencyp. 381
Programming pitfallsp. 382
Summaryp. 382
Exercisesp. 382
Testingp. 383
Introductionp. 383
Program specificationsp. 384
Exhaustive testingp. 385
Black box (functional) testingp. 385
White box (structural) testingp. 388
Inspections and walkthroughsp. 390
Stepping through codep. 391
Formal verificationp. 391
Incremental developmentp. 392
Programming principlesp. 392
Summaryp. 393
Exercisesp. 393
Answers to self-test questionsp. 395
Debuggingp. 397
Introductionp. 397
Debugging without a debuggerp. 399
Using a debuggerp. 400
Common errors - compilation errorsp. 401
Common errors - run-time errorsp. 402
Common errors - logic errorsp. 403
Common errors - misunderstanding the languagep. 403
Summaryp. 405
Answer to self-test questionp. 405
Threadsp. 406
Introductionp. 406
Threadsp. 407
Starting a threadp. 411
Thread dyingp. 412
joinp. 412
The state of a threadp. 412
Scheduling, thread priorities and yieldp. 413
Programming principlesp. 414
Summaryp. 414
Exercisesp. 415
Answers to self-test questionsp. 415
Interfacesp. 416
Introductionp. 416
Interfaces for designp. 416
Interfaces and interoperabilityp. 419
Interfaces and the Java libraryp. 420
Multiple interfacesp. 421
Interfaces versus abstract classesp. 423
Programming principlesp. 423
Programming pitfallsp. 423
Grammar spotp. 424
New language elementsp. 424
Summaryp. 424
Exercisesp. 424
Answers to self-test questionsp. 425
Programming in the large - packagesp. 426
Introductionp. 426
Using classes and the import statementp. 426
Creating packages using the package statementp. 427
Packages, files and foldersp. 428
Scope rulesp. 429
The Java library packagesp. 429
Programming pitfallsp. 430
New language elementsp. 430
Summaryp. 430
Exercisep. 430
Answers to self-test questionsp. 431
Polymorphismp. 432
Introductionp. 432
Polymorphism in actionp. 433
Programming principlesp. 437
Programming pitfallsp. 438
New language elementsp. 438
Summaryp. 439
Exercisesp. 439
Java in contextp. 441
Introductionp. 441
Simplep. 442
Object orientedp. 442
Platform independence (portability)p. 442
Performancep. 443
Securityp. 444
Netcentricp. 446
Microsoft versus the worldp. 447
The versions of Javap. 448
Java capabilitiesp. 448
Java librariesp. 448
Internationalizationp. 449
Databases - JDBCp. 449
RMI - Remote Method Invocationp. 450
Java beansp. 451
Java servlets and JSPp. 451
JavaScriptp. 452
Conclusionp. 453
Summaryp. 453
Exercisesp. 453
Appendices
Java librariesp. 454
The Abstract Window Toolkitp. 496
Appletsp. 500
Glossaryp. 504
Rules for namesp. 506
Keywordsp. 507
Scope rules (visibility)p. 508
Bibliographyp. 511
Using Java on Microsoft Windowsp. 514
Using the CD-ROMp. 518
Indexp. 519
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program