Skip to:Content
|
Bottom
Cover image for Fundamentals of Java programming companion guide
Title:
Fundamentals of Java programming companion guide
Series:
Cisco Press networking technology series
Publication Information:
Indianapolis, IN : Cisco Press, 2004
Physical Description:
1 CD-ROM ; 12 cm.
ISBN:
9781587130892
General Note:
Also available in printed version : QA76.3 F86 2004

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000004725366 CP 6497 Computer File Accompanies Open Access Book Compact Disc Accompanies Open Access Book
Searching...

On Order

Summary

Summary

The Official Companion Guide of the Cisco Networking Academy Program's Fundamentals of Java Programming course maps directly to the Cisco Networking Academy Program's web-based course and prepares students for the Sun Certified Programmer for Java 2 Platform exam.


Author Notes

The Cisco Systems Worldwide Education curriculum development team in Phoenix is the developer of the Cisco Networking Academy Program online curriculum, and is the co-developer of this book, with Aries Technology, Inc. Aries is a multimedia curriculum development company located in Tempe, Arizona who has been working with WWE in developing the online curriculum. Aries education products and information can be viewed at www.aries.net


Table of Contents

Introductionp. xxv
Chapter 1 What Is Java?p. 3
Computer Basicsp. 3
Brief History of Computersp. 4
Brief Future Sketch of Computersp. 9
Pervasive Nature of Computers and Computing in Today's Societyp. 11
Types of Computing and the Role of Computer Languages in These Areasp. 12
Hardwarep. 13
Softwarep. 14
Applicationsp. 17
Operating Systemsp. 17
What Is a Programming Language?p. 20
Definition of a Programming Languagep. 20
Switches, Ones, and Zerosp. 21
Early Programming Languagesp. 22
High-Level Languagesp. 23
Object-Oriented Programmingp. 24
Procedural Versus Object-Orientedp. 25
Basic Language Elementsp. 26
Differences Among Languagesp. 28
What Is Java?p. 30
Historical Background of Javap. 30
History of Java: Timelinep. 32
History of Java: Key Peoplep. 33
Use of Java as a Programming Languagep. 33
Java and the World Wide Webp. 37
Why Learn Java?p. 38
Java Environment Basicsp. 39
Understanding the Java Virtual Machinep. 40
How Java Programs Work on the Computerp. 42
Java Programp. 44
Organizing Resources to Create a Java Programp. 44
Understanding the Java 2 Software Development Kitp. 45
Understanding the Elements of a Simple Java Programp. 46
Three Steps to Creating and Executing a Java Programp. 48
Entering Data at Runtime for the Java Programp. 49
Modifying the HelloStudent Program to Accept Input at Runtimep. 49
Understanding Programming Error Messagesp. 52
Types of Errors in Programsp. 52
Editing a Java Program for Compiler Errorsp. 53
Editing a Java Program for Runtime Errorsp. 57
Understanding Integrated Development Environmentsp. 58
What Is an IDE?p. 58
Examples of IDEsp. 60
Basic Editing with the BlueJ IDEp. 61
BlueJ Tutorialp. 62
Case Study: JBANK, a Banking Applicationp. 63
Summaryp. 64
Syntax Summaryp. 65
Resourcesp. 65
Key Termsp. 67
Check Your Understandingp. 68
Chapter 2 Object-Oriented Programmingp. 73
Overview of Object-Oriented Programmingp. 73
Procedural Versus Object-Oriented Languagesp. 73
Basic Java Terminologyp. 75
What Are Objects?p. 76
Introduction to Objectsp. 77
Classification of Objectsp. 79
Identification of Objectsp. 81
Definition of Object Classesp. 82
Creation of Objectsp. 84
Operation on Objectsp. 85
Encapsulationp. 88
Object Relationshipsp. 90
Inheritancep. 92
Object Mutability and Destructionp. 94
Describing Objectsp. 95
Modeling Languages and Symbolsp. 95
Basic Class Symbolp. 98
Additional Types of UML Diagramsp. 100
Object Terminology Applied to a Java Programp. 106
Class Definitionp. 106
Creating Objectsp. 107
Object Methodsp. 109
Introduction to java.lang.System Classp. 111
System Classp. 111
Case Study: JBANK Applicationp. 113
Defining and Modeling the JBANK Applicationp. 113
The JavaZOOp. 114
Overview of the JavaZOOp. 114
Objectsp. 115
Data Typesp. 119
The main Methodp. 120
Instantiationp. 122
Methodsp. 124
Encapsulationp. 128
The Dot Operatorp. 136
Get Methodsp. 137
Value-Returning Methodsp. 138
Parametersp. 141
Set Methodsp. 143
Overloaded Methodsp. 146
Modifying Classesp. 149
Summaryp. 162
Syntax Summaryp. 163
Resourcesp. 163
Key Termsp. 165
Check Your Understandingp. 166
Chapter 3 Java Language Elementsp. 173
Documentationp. 174
Purpose of Documentationp. 174
An Overview of Pseudocodingp. 176
Guidelines for Documenting Classesp. 176
Historical Origins of the Three Kinds of Comments Used in Javap. 178
Javadoc Parametersp. 179
Java Language API Online Documentationp. 182
Generating API Docs for Classes Using the Javadoc Toolp. 188
Case Study: JBANK Applicationp. 190
Java Language Elementsp. 191
Review of Symbolsp. 192
Keywordsp. 193
Identifiersp. 198
Use of Braces, Semicolons, Commas, and Whitespacep. 200
The Where and When of Data Storagep. 202
Data Storage Introductionp. 202
Stack, Heap, Static, and Constant Storagep. 203
Variables and Storage Locations for Datap. 207
Concept of Data Typesp. 208
Java Language Typesp. 209
Java Primitives and Storage Requirementsp. 210
Java Referencesp. 214
Object Data (Instance)p. 216
Class Data (static)p. 220
Method Data (Local)p. 222
Constantsp. 226
Syntaxp. 227
Variablesp. 227
Classp. 230
Methodp. 232
Constructorsp. 235
Modifiers (public, private, protected, default, static, final)p. 237
Object Creation, Mutability, and Destructionp. 239
Object Creation: Constructorsp. 239
Object Creation by Another Classp. 242
Mutabilityp. 244
Garbage Collectionp. 245
Finalizersp. 247
Case Study: JBANK Applicationp. 247
JBANK Applicationp. 248
Summaryp. 249
Syntax Summaryp. 251
Resourcesp. 252
Key Termsp. 253
Check Your Understandingp. 255
Chapter 4 Java Language Operators and Control Structuresp. 261
Object Operationsp. 261
Object Operatorsp. 262
Numeric Data and Operationsp. 264
Assignment Operatorsp. 265
Arithmetic Operatorsp. 267
Precedence of Operatorsp. 270
Associative Properties of Operatorsp. 271
Arithmetic Calculationsp. 272
Boolean Datap. 276
Comparison and Logical Operatorsp. 277
Conditional Operatorp. 282
Bitwise Operatorsp. 284
Concepts of Casting and Conversionp. 285
Casting and Conversionp. 285
Character and String Datap. 287
Character Data Typep. 288
Introduction to String and StringBuffer Classp. 288
Control Structuresp. 290
Decision Making and Repetitionp. 291
Logicp. 292
if Statementp. 293
Multiple-Condition ifp. 297
Nested ifp. 299
switch Statementsp. 302
Loopp. 307
do while Statementp. 307
while Statementp. 308
for Statementp. 309
Use of break, continue, and Labelp. 310
Exploring the java.lang.System Class Member in and outp. 313
The java.lang.System Classp. 313
Dissecting Sample Codep. 315
Sample Code Using Operators and Control Structuresp. 315
Summaryp. 321
Syntax Summaryp. 322
Key Termsp. 325
Check Your Understandingp. 327
Chapter 5 Basics of Defining and Using Classesp. 333
Reviewp. 333
A Review of Class and Object Definitionsp. 334
Four Steps to Creating Objectsp. 335
Designing Classesp. 335
Define a Classp. 337
Create an Objectp. 350
Using the Objectp. 354
Attributes (Class and Instance)p. 359
Overviewp. 360
Variablesp. 363
Instance Variablesp. 366
Class Data and Static Variablesp. 369
Immutabilityp. 372
Encapsulationp. 375
The Concept of Encapsulationp. 375
Access Modifiersp. 376
Constructorsp. 379
The Constructor Processp. 379
Default Constructorp. 383
Defined Constructorp. 384
Method Types and Syntaxp. 385
Method Syntaxp. 385
Method Bodyp. 387
Method Namep. 389
Return Valuep. 390
Method Argumentsp. 396
Concept of Pass-by-Valuep. 397
main Methodp. 402
Instance Methodsp. 404
Class Methodsp. 407
The Variable thisp. 408
Using this in Constructors and Methodsp. 408
Method Data and Encapsulationp. 411
Data Sourcesp. 411
Implementing Encapsulation Using Methodsp. 413
Overloadingp. 416
Overloading Methodsp. 417
Overloading Constructorsp. 419
Java Type Lifespanp. 423
Initializing Datap. 423
Scope of Variablesp. 428
Lifetime of an Objectp. 431
Mutability of an Objectp. 436
Destruction of an Objectp. 438
Finalizersp. 440
Case Study: JBANK Applicationp. 442
The JBANK Applicationp. 443
Summaryp. 444
Syntax Summaryp. 445
Key Termsp. 448
Check Your Understandingp. 450
Chapter 6 System, String, StringBuffer, Math, and Wrapper Classesp. 457
System Classp. 457
Use of the System Class for Input and Outputp. 457
Input Using System.inp. 460
Output Using System.outp. 467
String Classp. 469
Creating String Objectsp. 469
String Methodsp. 472
Casting and Conversionp. 475
StringBuffer Classp. 481
Methodsp. 481
Input Selection and Repetition Using the Console Classp. 483
The Console Classp. 483
Wrapper Classesp. 488
Introduction to Wrapper Classesp. 488
Wrapper Classes and Their Associated Methodsp. 490
Math Classp. 496
Static Methodsp. 497
math Packagep. 498
Storing Numeric Data in Objectsp. 498
Working with Dates and Random Numbersp. 504
Creating Datesp. 504
Setting Datesp. 507
Formatting Datesp. 508
Random Numbersp. 511
Case Study: JBANK Applicationp. 515
The JBANK Applicationp. 515
Summaryp. 517
Syntax Summaryp. 517
Key Termsp. 521
Check Your Understandingp. 522
Chapter 7 Arraysp. 529
Introductionp. 529
Arraysp. 529
Introduction to Arraysp. 530
Variables in Arraysp. 531
Indexp. 533
Array Elementsp. 534
Arrays of Primitivesp. 535
Arrays of Objectsp. 537
Declaring and Initializing Arraysp. 538
Declaring Arraysp. 538
Using Subscripts to Access Elements of an Arrayp. 542
Initializing Arraysp. 543
Array of Primitivesp. 543
Array of Objectsp. 546
Initializer Blocksp. 548
Using Arraysp. 550
Accessing Array Elementsp. 551
Passing an Array to a Methodp. 555
Using Parallel Arraysp. 557
Searching and Sorting an Arrayp. 558
Reusing an Arrayp. 567
Multidimensional Arraysp. 568
Initializing Multidimensional Array Objectsp. 568
Traversing a Multidimensional Arrayp. 570
Case Study: JBANK Applicationp. 574
Using an Array Within the JBANKp. 575
Summaryp. 576
Syntax Summaryp. 576
Key Termsp. 578
Check Your Understandingp. 579
Chapter 8 Classes and Inheritancep. 585
Inheritance and Object-Oriented Programmingp. 586
Inheritancep. 586
Abstractionp. 588
The Problem of Multiple Inheritancep. 591
Java Language Support for Inheritancep. 594
Java Language Keywords in Inheritancep. 594
Object Classp. 595
Access Modifiers and Inheritancep. 597
Role of Access Modifiers in Inheritancep. 597
Overridingp. 600
Method Overridingp. 601
Overriding of Object Class Methodsp. 602
Overloading versus Overridingp. 607
Use of this and superp. 609
Accessing Parent and Subclass Methods and Datap. 609
Inheritance and Constructorsp. 612
Handling Constructors in Inheritancep. 612
Extending Classesp. 616
Abstract Classesp. 616
Use of final in Inheritancep. 619
Interfacesp. 621
What and Why of Interfacesp. 621
Implementing Interfacesp. 623
Polymorphism, Dynamic Binding, and Virtual Method Invocationp. 624
Polymorphismp. 624
Virtual Method Invocation or Dynamic Method Bindingp. 626
Case Study: JBANK Applicationp. 627
The JBANK Applicationp. 627
Summaryp. 628
Syntax Summaryp. 629
Key Termsp. 633
Check Your Understandingp. 634
Chapter 9 Understanding Packagesp. 641
Java Packagesp. 641
A Collection of Classesp. 642
Class Loading and How it Worksp. 643
Locating Explicit Package Declarationsp. 648
Packages and Names in Programsp. 653
Three Effects of Packages on Object-Oriented Designp. 653
Packaging Classesp. 654
Accessing Packagesp. 659
Accessing Packagesp. 659
Case Study: Banking Application, Building Packagesp. 660
Exploring the API Packagesp. 661
Creating a Banking Packagep. 665
Using AWTp. 665
Understanding the Model View Controller Programp. 666
Applying Inheritance Conceptsp. 671
AWT Hierarchyp. 674
Case Study: JBANK Applicationp. 676
JBANK GUIp. 676
Summaryp. 677
Syntax Summaryp. 678
Key Termsp. 679
Check Your Understandingp. 680
Chapter 10 Creating GUIs Using AWTp. 685
Overviewp. 685
Reviewing AWTp. 686
The AWT Classesp. 686
Steps to Create a GUIp. 691
Designing the Classp. 692
Creating the Componentsp. 693
Selecting Containersp. 700
Using Layout Managersp. 705
Sizing Components and Containersp. 713
Displaying the GUIp. 714
GUI Functionalityp. 714
Event-Delegation Modelp. 714
Event Objectsp. 716
Listener Classesp. 718
Adapter Classesp. 722
Inner Classesp. 724
Anonymous Classesp. 729
Study: Banking Applicationp. 732
Banking Applicationp. 732
Summaryp. 733
Key Termsp. 735
Check Your Understandingp. 736
Chapter 11 Applets and Graphicsp. 743
Appletsp. 743
Defining Appletsp. 744
Launching Appletsp. 744
Applets and Securityp. 755
Embedding a Java Appletp. 755
Creating an Appletp. 757
Creating an Appletp. 758
Applet Class Hierarchiesp. 759
Class Hierarchiesp. 759
Applet Methodsp. 760
Applet Inherited Methodsp. 761
Applet Life Cycle Methodsp. 763
GUI Components in Appletsp. 765
GUI Componentsp. 765
Colorp. 768
Fontp. 769
Other Applet Methodsp. 772
Applets and Event-Driven Programmingp. 776
Event-Driven Programmingp. 777
Graphic Objectsp. 780
Creating Graphic Objectsp. 780
Painting and Repainting Graphicsp. 784
Case Study: Banking Applicationp. 786
Applying Concepts to the Banking Applicationp. 786
Summaryp. 787
Syntax Summaryp. 787
Key Termsp. 789
Check Your Understandingp. 791
Chapter 12 Exceptionsp. 797
Idea Behind Exceptionsp. 797
The Limitations of Traditional Methods of Exception Handlingp. 797
Error Handling in the Java Platformp. 798
Types of Exceptionsp. 803
Types of Errorsp. 803
How Exception Handling Worksp. 804
Throwing and Handling Exception Objectsp. 804
Exception Objectsp. 806
Class Throwablep. 806
Exception and Its Subclassesp. 811
RuntimeException Classp. 813
Fatal Errorsp. 813
Dealing with Exceptionsp. 814
Advertising Exceptionsp. 814
Handle and Declarep. 815
Using the try/catch Blockp. 818
Specifying Exceptionsp. 820
Catching Multiple Exceptionsp. 823
The finally Blockp. 829
Exception Objectsp. 834
Creating an Exception Classp. 834
Using User-Defined Exceptionsp. 836
Handling User-Defined Exceptionsp. 838
Structuring a Method and the Execution Sequencep. 841
The Order of Exception Blocksp. 841
Execution Sequencep. 842
Execution When an Exception Is Thrownp. 843
Execution When an Exception Is Not Caughtp. 845
Nested try Blocksp. 846
Rethrowing Exceptionsp. 847
Overriding and Exceptionsp. 849
Rules for Overriding Methodsp. 849
Case Study: JBANK Banking Applicationp. 852
Applying Concepts to the Banking Applicationp. 852
Syntax Summaryp. 853
Summaryp. 855
Key Termsp. 856
Check Your Understandingp. 858
Chapter 13 Files, Streams, Input, and Outputp. 865
Understanding Filesp. 866
File Classp. 866
RandomAccessFile Classp. 873
Input and Output Classesp. 878
I/O Class Hierarchyp. 878
Understanding Streamsp. 880
Low-Level and High-Level Streamsp. 883
Instruction for Input and Output Operationsp. 894
I/O Operationsp. 894
Storing Objects in a Filep. 898
Serializationp. 898
Writing and Reading Objectsp. 901
Case Study: Banking Applicationp. 903
Applying Concepts to the Banking Applicationp. 903
Summaryp. 904
Syntax Summaryp. 905
Key Termsp. 906
Check Your Understandingp. 907
Chapter 14 Collectionsp. 913
The java.util Packagep. 913
The java.util Packagep. 914
Collectionsp. 917
Understanding Collectionsp. 917
Collection Storage Techniquesp. 918
Properties of Collectionsp. 921
Types of Collectionsp. 922
The Collections Frameworkp. 925
Overviewp. 925
Collection Interfacesp. 926
Collection Classesp. 928
Set Objectsp. 930
List Objectsp. 934
Map Objectsp. 939
Iteratorsp. 947
Sorting and Shuffling List Objectsp. 951
Case Study JBANK Applicationp. 954
The JBANK Applicationp. 955
Summaryp. 956
Syntax Summaryp. 956
Key Termsp. 962
Check Your Understandingp. 963
Threadsp. 969
Threads and Multithreadingp. 969
Understanding Threads and Multithreadingp. 970
Multiprocessingp. 974
The Thread Class and the Runnable Interfacep. 975
Thread Classp. 975
Runnable Interfacep. 976
Thread Class Methodsp. 976
Creating and Running Threadsp. 977
The run() Methodp. 977
Running Threadsp. 980
The Life Cycle of a Threadp. 982
Thread Statesp. 983
Managing Threadsp. 984
Blocked Statep. 984
Thread Schedulingp. 987
Stopping Threadsp. 990
Synchronization and Deadlocksp. 992
Communication Between Threadsp. 996
Table of Thread Control Methodsp. 998
Summaryp. 999
Syntax Summaryp. 1000
Key Termsp. 1002
Check Your Understandingp. 1004
Appendix A Glossary of Key Termsp. 1009
Appendix B Check Your Understanding Answer Keyp. 1037
Appendix C Fundamentals of Java Programming and the College Boardp. 1051
Appendix D Operator Precedence Chartp. 1073
Appendix E ASCII Character Setp. 1077
Indexp. 1081
Go to:Top of Page