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
Introduction | p. xxv |
Chapter 1 What Is Java? | p. 3 |
Computer Basics | p. 3 |
Brief History of Computers | p. 4 |
Brief Future Sketch of Computers | p. 9 |
Pervasive Nature of Computers and Computing in Today's Society | p. 11 |
Types of Computing and the Role of Computer Languages in These Areas | p. 12 |
Hardware | p. 13 |
Software | p. 14 |
Applications | p. 17 |
Operating Systems | p. 17 |
What Is a Programming Language? | p. 20 |
Definition of a Programming Language | p. 20 |
Switches, Ones, and Zeros | p. 21 |
Early Programming Languages | p. 22 |
High-Level Languages | p. 23 |
Object-Oriented Programming | p. 24 |
Procedural Versus Object-Oriented | p. 25 |
Basic Language Elements | p. 26 |
Differences Among Languages | p. 28 |
What Is Java? | p. 30 |
Historical Background of Java | p. 30 |
History of Java: Timeline | p. 32 |
History of Java: Key People | p. 33 |
Use of Java as a Programming Language | p. 33 |
Java and the World Wide Web | p. 37 |
Why Learn Java? | p. 38 |
Java Environment Basics | p. 39 |
Understanding the Java Virtual Machine | p. 40 |
How Java Programs Work on the Computer | p. 42 |
Java Program | p. 44 |
Organizing Resources to Create a Java Program | p. 44 |
Understanding the Java 2 Software Development Kit | p. 45 |
Understanding the Elements of a Simple Java Program | p. 46 |
Three Steps to Creating and Executing a Java Program | p. 48 |
Entering Data at Runtime for the Java Program | p. 49 |
Modifying the HelloStudent Program to Accept Input at Runtime | p. 49 |
Understanding Programming Error Messages | p. 52 |
Types of Errors in Programs | p. 52 |
Editing a Java Program for Compiler Errors | p. 53 |
Editing a Java Program for Runtime Errors | p. 57 |
Understanding Integrated Development Environments | p. 58 |
What Is an IDE? | p. 58 |
Examples of IDEs | p. 60 |
Basic Editing with the BlueJ IDE | p. 61 |
BlueJ Tutorial | p. 62 |
Case Study: JBANK, a Banking Application | p. 63 |
Summary | p. 64 |
Syntax Summary | p. 65 |
Resources | p. 65 |
Key Terms | p. 67 |
Check Your Understanding | p. 68 |
Chapter 2 Object-Oriented Programming | p. 73 |
Overview of Object-Oriented Programming | p. 73 |
Procedural Versus Object-Oriented Languages | p. 73 |
Basic Java Terminology | p. 75 |
What Are Objects? | p. 76 |
Introduction to Objects | p. 77 |
Classification of Objects | p. 79 |
Identification of Objects | p. 81 |
Definition of Object Classes | p. 82 |
Creation of Objects | p. 84 |
Operation on Objects | p. 85 |
Encapsulation | p. 88 |
Object Relationships | p. 90 |
Inheritance | p. 92 |
Object Mutability and Destruction | p. 94 |
Describing Objects | p. 95 |
Modeling Languages and Symbols | p. 95 |
Basic Class Symbol | p. 98 |
Additional Types of UML Diagrams | p. 100 |
Object Terminology Applied to a Java Program | p. 106 |
Class Definition | p. 106 |
Creating Objects | p. 107 |
Object Methods | p. 109 |
Introduction to java.lang.System Class | p. 111 |
System Class | p. 111 |
Case Study: JBANK Application | p. 113 |
Defining and Modeling the JBANK Application | p. 113 |
The JavaZOO | p. 114 |
Overview of the JavaZOO | p. 114 |
Objects | p. 115 |
Data Types | p. 119 |
The main Method | p. 120 |
Instantiation | p. 122 |
Methods | p. 124 |
Encapsulation | p. 128 |
The Dot Operator | p. 136 |
Get Methods | p. 137 |
Value-Returning Methods | p. 138 |
Parameters | p. 141 |
Set Methods | p. 143 |
Overloaded Methods | p. 146 |
Modifying Classes | p. 149 |
Summary | p. 162 |
Syntax Summary | p. 163 |
Resources | p. 163 |
Key Terms | p. 165 |
Check Your Understanding | p. 166 |
Chapter 3 Java Language Elements | p. 173 |
Documentation | p. 174 |
Purpose of Documentation | p. 174 |
An Overview of Pseudocoding | p. 176 |
Guidelines for Documenting Classes | p. 176 |
Historical Origins of the Three Kinds of Comments Used in Java | p. 178 |
Javadoc Parameters | p. 179 |
Java Language API Online Documentation | p. 182 |
Generating API Docs for Classes Using the Javadoc Tool | p. 188 |
Case Study: JBANK Application | p. 190 |
Java Language Elements | p. 191 |
Review of Symbols | p. 192 |
Keywords | p. 193 |
Identifiers | p. 198 |
Use of Braces, Semicolons, Commas, and Whitespace | p. 200 |
The Where and When of Data Storage | p. 202 |
Data Storage Introduction | p. 202 |
Stack, Heap, Static, and Constant Storage | p. 203 |
Variables and Storage Locations for Data | p. 207 |
Concept of Data Types | p. 208 |
Java Language Types | p. 209 |
Java Primitives and Storage Requirements | p. 210 |
Java References | p. 214 |
Object Data (Instance) | p. 216 |
Class Data (static) | p. 220 |
Method Data (Local) | p. 222 |
Constants | p. 226 |
Syntax | p. 227 |
Variables | p. 227 |
Class | p. 230 |
Method | p. 232 |
Constructors | p. 235 |
Modifiers (public, private, protected, default, static, final) | p. 237 |
Object Creation, Mutability, and Destruction | p. 239 |
Object Creation: Constructors | p. 239 |
Object Creation by Another Class | p. 242 |
Mutability | p. 244 |
Garbage Collection | p. 245 |
Finalizers | p. 247 |
Case Study: JBANK Application | p. 247 |
JBANK Application | p. 248 |
Summary | p. 249 |
Syntax Summary | p. 251 |
Resources | p. 252 |
Key Terms | p. 253 |
Check Your Understanding | p. 255 |
Chapter 4 Java Language Operators and Control Structures | p. 261 |
Object Operations | p. 261 |
Object Operators | p. 262 |
Numeric Data and Operations | p. 264 |
Assignment Operators | p. 265 |
Arithmetic Operators | p. 267 |
Precedence of Operators | p. 270 |
Associative Properties of Operators | p. 271 |
Arithmetic Calculations | p. 272 |
Boolean Data | p. 276 |
Comparison and Logical Operators | p. 277 |
Conditional Operator | p. 282 |
Bitwise Operators | p. 284 |
Concepts of Casting and Conversion | p. 285 |
Casting and Conversion | p. 285 |
Character and String Data | p. 287 |
Character Data Type | p. 288 |
Introduction to String and StringBuffer Class | p. 288 |
Control Structures | p. 290 |
Decision Making and Repetition | p. 291 |
Logic | p. 292 |
if Statement | p. 293 |
Multiple-Condition if | p. 297 |
Nested if | p. 299 |
switch Statements | p. 302 |
Loop | p. 307 |
do while Statement | p. 307 |
while Statement | p. 308 |
for Statement | p. 309 |
Use of break, continue, and Label | p. 310 |
Exploring the java.lang.System Class Member in and out | p. 313 |
The java.lang.System Class | p. 313 |
Dissecting Sample Code | p. 315 |
Sample Code Using Operators and Control Structures | p. 315 |
Summary | p. 321 |
Syntax Summary | p. 322 |
Key Terms | p. 325 |
Check Your Understanding | p. 327 |
Chapter 5 Basics of Defining and Using Classes | p. 333 |
Review | p. 333 |
A Review of Class and Object Definitions | p. 334 |
Four Steps to Creating Objects | p. 335 |
Designing Classes | p. 335 |
Define a Class | p. 337 |
Create an Object | p. 350 |
Using the Object | p. 354 |
Attributes (Class and Instance) | p. 359 |
Overview | p. 360 |
Variables | p. 363 |
Instance Variables | p. 366 |
Class Data and Static Variables | p. 369 |
Immutability | p. 372 |
Encapsulation | p. 375 |
The Concept of Encapsulation | p. 375 |
Access Modifiers | p. 376 |
Constructors | p. 379 |
The Constructor Process | p. 379 |
Default Constructor | p. 383 |
Defined Constructor | p. 384 |
Method Types and Syntax | p. 385 |
Method Syntax | p. 385 |
Method Body | p. 387 |
Method Name | p. 389 |
Return Value | p. 390 |
Method Arguments | p. 396 |
Concept of Pass-by-Value | p. 397 |
main Method | p. 402 |
Instance Methods | p. 404 |
Class Methods | p. 407 |
The Variable this | p. 408 |
Using this in Constructors and Methods | p. 408 |
Method Data and Encapsulation | p. 411 |
Data Sources | p. 411 |
Implementing Encapsulation Using Methods | p. 413 |
Overloading | p. 416 |
Overloading Methods | p. 417 |
Overloading Constructors | p. 419 |
Java Type Lifespan | p. 423 |
Initializing Data | p. 423 |
Scope of Variables | p. 428 |
Lifetime of an Object | p. 431 |
Mutability of an Object | p. 436 |
Destruction of an Object | p. 438 |
Finalizers | p. 440 |
Case Study: JBANK Application | p. 442 |
The JBANK Application | p. 443 |
Summary | p. 444 |
Syntax Summary | p. 445 |
Key Terms | p. 448 |
Check Your Understanding | p. 450 |
Chapter 6 System, String, StringBuffer, Math, and Wrapper Classes | p. 457 |
System Class | p. 457 |
Use of the System Class for Input and Output | p. 457 |
Input Using System.in | p. 460 |
Output Using System.out | p. 467 |
String Class | p. 469 |
Creating String Objects | p. 469 |
String Methods | p. 472 |
Casting and Conversion | p. 475 |
StringBuffer Class | p. 481 |
Methods | p. 481 |
Input Selection and Repetition Using the Console Class | p. 483 |
The Console Class | p. 483 |
Wrapper Classes | p. 488 |
Introduction to Wrapper Classes | p. 488 |
Wrapper Classes and Their Associated Methods | p. 490 |
Math Class | p. 496 |
Static Methods | p. 497 |
math Package | p. 498 |
Storing Numeric Data in Objects | p. 498 |
Working with Dates and Random Numbers | p. 504 |
Creating Dates | p. 504 |
Setting Dates | p. 507 |
Formatting Dates | p. 508 |
Random Numbers | p. 511 |
Case Study: JBANK Application | p. 515 |
The JBANK Application | p. 515 |
Summary | p. 517 |
Syntax Summary | p. 517 |
Key Terms | p. 521 |
Check Your Understanding | p. 522 |
Chapter 7 Arrays | p. 529 |
Introduction | p. 529 |
Arrays | p. 529 |
Introduction to Arrays | p. 530 |
Variables in Arrays | p. 531 |
Index | p. 533 |
Array Elements | p. 534 |
Arrays of Primitives | p. 535 |
Arrays of Objects | p. 537 |
Declaring and Initializing Arrays | p. 538 |
Declaring Arrays | p. 538 |
Using Subscripts to Access Elements of an Array | p. 542 |
Initializing Arrays | p. 543 |
Array of Primitives | p. 543 |
Array of Objects | p. 546 |
Initializer Blocks | p. 548 |
Using Arrays | p. 550 |
Accessing Array Elements | p. 551 |
Passing an Array to a Method | p. 555 |
Using Parallel Arrays | p. 557 |
Searching and Sorting an Array | p. 558 |
Reusing an Array | p. 567 |
Multidimensional Arrays | p. 568 |
Initializing Multidimensional Array Objects | p. 568 |
Traversing a Multidimensional Array | p. 570 |
Case Study: JBANK Application | p. 574 |
Using an Array Within the JBANK | p. 575 |
Summary | p. 576 |
Syntax Summary | p. 576 |
Key Terms | p. 578 |
Check Your Understanding | p. 579 |
Chapter 8 Classes and Inheritance | p. 585 |
Inheritance and Object-Oriented Programming | p. 586 |
Inheritance | p. 586 |
Abstraction | p. 588 |
The Problem of Multiple Inheritance | p. 591 |
Java Language Support for Inheritance | p. 594 |
Java Language Keywords in Inheritance | p. 594 |
Object Class | p. 595 |
Access Modifiers and Inheritance | p. 597 |
Role of Access Modifiers in Inheritance | p. 597 |
Overriding | p. 600 |
Method Overriding | p. 601 |
Overriding of Object Class Methods | p. 602 |
Overloading versus Overriding | p. 607 |
Use of this and super | p. 609 |
Accessing Parent and Subclass Methods and Data | p. 609 |
Inheritance and Constructors | p. 612 |
Handling Constructors in Inheritance | p. 612 |
Extending Classes | p. 616 |
Abstract Classes | p. 616 |
Use of final in Inheritance | p. 619 |
Interfaces | p. 621 |
What and Why of Interfaces | p. 621 |
Implementing Interfaces | p. 623 |
Polymorphism, Dynamic Binding, and Virtual Method Invocation | p. 624 |
Polymorphism | p. 624 |
Virtual Method Invocation or Dynamic Method Binding | p. 626 |
Case Study: JBANK Application | p. 627 |
The JBANK Application | p. 627 |
Summary | p. 628 |
Syntax Summary | p. 629 |
Key Terms | p. 633 |
Check Your Understanding | p. 634 |
Chapter 9 Understanding Packages | p. 641 |
Java Packages | p. 641 |
A Collection of Classes | p. 642 |
Class Loading and How it Works | p. 643 |
Locating Explicit Package Declarations | p. 648 |
Packages and Names in Programs | p. 653 |
Three Effects of Packages on Object-Oriented Design | p. 653 |
Packaging Classes | p. 654 |
Accessing Packages | p. 659 |
Accessing Packages | p. 659 |
Case Study: Banking Application, Building Packages | p. 660 |
Exploring the API Packages | p. 661 |
Creating a Banking Package | p. 665 |
Using AWT | p. 665 |
Understanding the Model View Controller Program | p. 666 |
Applying Inheritance Concepts | p. 671 |
AWT Hierarchy | p. 674 |
Case Study: JBANK Application | p. 676 |
JBANK GUI | p. 676 |
Summary | p. 677 |
Syntax Summary | p. 678 |
Key Terms | p. 679 |
Check Your Understanding | p. 680 |
Chapter 10 Creating GUIs Using AWT | p. 685 |
Overview | p. 685 |
Reviewing AWT | p. 686 |
The AWT Classes | p. 686 |
Steps to Create a GUI | p. 691 |
Designing the Class | p. 692 |
Creating the Components | p. 693 |
Selecting Containers | p. 700 |
Using Layout Managers | p. 705 |
Sizing Components and Containers | p. 713 |
Displaying the GUI | p. 714 |
GUI Functionality | p. 714 |
Event-Delegation Model | p. 714 |
Event Objects | p. 716 |
Listener Classes | p. 718 |
Adapter Classes | p. 722 |
Inner Classes | p. 724 |
Anonymous Classes | p. 729 |
Study: Banking Application | p. 732 |
Banking Application | p. 732 |
Summary | p. 733 |
Key Terms | p. 735 |
Check Your Understanding | p. 736 |
Chapter 11 Applets and Graphics | p. 743 |
Applets | p. 743 |
Defining Applets | p. 744 |
Launching Applets | p. 744 |
Applets and Security | p. 755 |
Embedding a Java Applet | p. 755 |
Creating an Applet | p. 757 |
Creating an Applet | p. 758 |
Applet Class Hierarchies | p. 759 |
Class Hierarchies | p. 759 |
Applet Methods | p. 760 |
Applet Inherited Methods | p. 761 |
Applet Life Cycle Methods | p. 763 |
GUI Components in Applets | p. 765 |
GUI Components | p. 765 |
Color | p. 768 |
Font | p. 769 |
Other Applet Methods | p. 772 |
Applets and Event-Driven Programming | p. 776 |
Event-Driven Programming | p. 777 |
Graphic Objects | p. 780 |
Creating Graphic Objects | p. 780 |
Painting and Repainting Graphics | p. 784 |
Case Study: Banking Application | p. 786 |
Applying Concepts to the Banking Application | p. 786 |
Summary | p. 787 |
Syntax Summary | p. 787 |
Key Terms | p. 789 |
Check Your Understanding | p. 791 |
Chapter 12 Exceptions | p. 797 |
Idea Behind Exceptions | p. 797 |
The Limitations of Traditional Methods of Exception Handling | p. 797 |
Error Handling in the Java Platform | p. 798 |
Types of Exceptions | p. 803 |
Types of Errors | p. 803 |
How Exception Handling Works | p. 804 |
Throwing and Handling Exception Objects | p. 804 |
Exception Objects | p. 806 |
Class Throwable | p. 806 |
Exception and Its Subclasses | p. 811 |
RuntimeException Class | p. 813 |
Fatal Errors | p. 813 |
Dealing with Exceptions | p. 814 |
Advertising Exceptions | p. 814 |
Handle and Declare | p. 815 |
Using the try/catch Block | p. 818 |
Specifying Exceptions | p. 820 |
Catching Multiple Exceptions | p. 823 |
The finally Block | p. 829 |
Exception Objects | p. 834 |
Creating an Exception Class | p. 834 |
Using User-Defined Exceptions | p. 836 |
Handling User-Defined Exceptions | p. 838 |
Structuring a Method and the Execution Sequence | p. 841 |
The Order of Exception Blocks | p. 841 |
Execution Sequence | p. 842 |
Execution When an Exception Is Thrown | p. 843 |
Execution When an Exception Is Not Caught | p. 845 |
Nested try Blocks | p. 846 |
Rethrowing Exceptions | p. 847 |
Overriding and Exceptions | p. 849 |
Rules for Overriding Methods | p. 849 |
Case Study: JBANK Banking Application | p. 852 |
Applying Concepts to the Banking Application | p. 852 |
Syntax Summary | p. 853 |
Summary | p. 855 |
Key Terms | p. 856 |
Check Your Understanding | p. 858 |
Chapter 13 Files, Streams, Input, and Output | p. 865 |
Understanding Files | p. 866 |
File Class | p. 866 |
RandomAccessFile Class | p. 873 |
Input and Output Classes | p. 878 |
I/O Class Hierarchy | p. 878 |
Understanding Streams | p. 880 |
Low-Level and High-Level Streams | p. 883 |
Instruction for Input and Output Operations | p. 894 |
I/O Operations | p. 894 |
Storing Objects in a File | p. 898 |
Serialization | p. 898 |
Writing and Reading Objects | p. 901 |
Case Study: Banking Application | p. 903 |
Applying Concepts to the Banking Application | p. 903 |
Summary | p. 904 |
Syntax Summary | p. 905 |
Key Terms | p. 906 |
Check Your Understanding | p. 907 |
Chapter 14 Collections | p. 913 |
The java.util Package | p. 913 |
The java.util Package | p. 914 |
Collections | p. 917 |
Understanding Collections | p. 917 |
Collection Storage Techniques | p. 918 |
Properties of Collections | p. 921 |
Types of Collections | p. 922 |
The Collections Framework | p. 925 |
Overview | p. 925 |
Collection Interfaces | p. 926 |
Collection Classes | p. 928 |
Set Objects | p. 930 |
List Objects | p. 934 |
Map Objects | p. 939 |
Iterators | p. 947 |
Sorting and Shuffling List Objects | p. 951 |
Case Study JBANK Application | p. 954 |
The JBANK Application | p. 955 |
Summary | p. 956 |
Syntax Summary | p. 956 |
Key Terms | p. 962 |
Check Your Understanding | p. 963 |
Threads | p. 969 |
Threads and Multithreading | p. 969 |
Understanding Threads and Multithreading | p. 970 |
Multiprocessing | p. 974 |
The Thread Class and the Runnable Interface | p. 975 |
Thread Class | p. 975 |
Runnable Interface | p. 976 |
Thread Class Methods | p. 976 |
Creating and Running Threads | p. 977 |
The run() Method | p. 977 |
Running Threads | p. 980 |
The Life Cycle of a Thread | p. 982 |
Thread States | p. 983 |
Managing Threads | p. 984 |
Blocked State | p. 984 |
Thread Scheduling | p. 987 |
Stopping Threads | p. 990 |
Synchronization and Deadlocks | p. 992 |
Communication Between Threads | p. 996 |
Table of Thread Control Methods | p. 998 |
Summary | p. 999 |
Syntax Summary | p. 1000 |
Key Terms | p. 1002 |
Check Your Understanding | p. 1004 |
Appendix A Glossary of Key Terms | p. 1009 |
Appendix B Check Your Understanding Answer Key | p. 1037 |
Appendix C Fundamentals of Java Programming and the College Board | p. 1051 |
Appendix D Operator Precedence Chart | p. 1073 |
Appendix E ASCII Character Set | p. 1077 |
Index | p. 1081 |