
Because Knetbooks knows college students. Our rental program is designed to save you time and money. Whether you need a textbook for a semester, quarter or even a summer session, we have an option for you. Simply select a rental period, enter your information and your book will be on its way!
| Fundamentals of Programming | p. 1 |
| Introduction to Computers, Programs, and Java | p. 3 |
| Introduction | p. 4 |
| What Is a Computer? | p. 4 |
| Programs | p. 7 |
| Operating Systems | p. 10 |
| (Optional) Number Systems | p. 11 |
| Java, the World Wide Web, and Beyond | p. 14 |
| The Java Language Specification, API, JDK, and IDE | p. 16 |
| A Simple Java... MORE | p. 17 |
| Creating, Compiling, and Executing a Java Program | p. 18 |
| Anatomy of a Java Program | p. 20 |
| Displaying Text in a Message Dialog Box | p. 22 |
| Primitive Data Types and Operations | p. 27 |
| Introduction | p. 28 |
| Writing Simple Programs | p. 28 |
| Identifiers | p. 30 |
| Variables | p. 31 |
| Assignment Statements and Assignment Expressions | p. 32 |
| Constants | p. 33 |
| Numeric Data Types and Operations | p. 34 |
| Numeric Type Conversions | p. 40 |
| Character Data Type and Operations | p. 41 |
| The String Type | p. 44 |
| Getting Input from Input Dialogs | p. 45 |
| Case Studies | p. 46 |
| Getting Input from the Console | p. 52 |
| Programming Style and Documentation | p. 55 |
| Programming Errors | p. 57 |
| Debugging | p. 58 |
| Selection Statements | p. 67 |
| Introduction | p. 68 |
| Boolean Data Type and Operations | p. 68 |
| If Statements | p. 73 |
| Switch Statements | p. 81 |
| Conditional Expressions | p. 83 |
| Formatting Console Output and Strings | p. 84 |
| Operator Precedence and Associativity | p. 86 |
| Operand Evaluation Order | p. 87 |
| Loops | p. 95 |
| Introduction | p. 96 |
| The while Loop | p. 96 |
| The do-while Loop | p. 100 |
| The for Loop | p. 102 |
| Which Loop to Use? | p. 104 |
| Nested Loops | p. 105 |
| Minimizing Numerical Errors | p. 106 |
| Case Studies | p. 108 |
| Keywords break and continue | p. 113 |
| Methods | p. 129 |
| Introduction | p. 130 |
| Creating a Method | p. 130 |
| Calling a Method | p. 131 |
| Void Method Example | p. 134 |
| Passing Parameters by Values | p. 135 |
| Overloading Methods | p. 137 |
| Case Study: Computing Taxes with Methods | p. 139 |
| The Scope of Variables | p. 141 |
| The Math Class | p. 142 |
| Case Study: Generating Random Characters | p. 145 |
| Method Abstraction and Stepwise Refinement | p. 146 |
| (Optional) Packages | p. 154 |
| Arrays | p. 169 |
| Introduction | p. 170 |
| Array Basics | p. 170 |
| Copying Arrays | p. 177 |
| Passing Arrays to Methods | p. 179 |
| Returning an Array from a Method | p. 181 |
| (Optional) Variable-Length Argument Lists | p. 185 |
| Searching Arrays | p. 186 |
| Sorting Arrays | p. 188 |
| The Arrays Class | p. 191 |
| Two-Dimensional Arrays | p. 193 |
| (Optional) Multidimensional Arrays | p. 199 |
| Object-Oriented Programming | p. 211 |
| Objects and Classes | p. 213 |
| Introduction | p. 214 |
| Defining Classes for Objects | p. 214 |
| Constructors | p. 216 |
| Accessing Objects via Reference Variables | p. 216 |
| Using Classes from the Java Library | p. 222 |
| Static Variables, Constants, and Methods | p. 224 |
| Visibility Modifiers | p. 228 |
| Data Field Encapsulation | p. 229 |
| Immutable Objects and Classes | p. 232 |
| Passing Objects to Methods | p. 233 |
| The Scope of Variables | p. 235 |
| The this Keyword | p. 236 |
| Array of Objects | p. 237 |
| Class Abstraction and Encapsulation | p. 239 |
| Case Study: The Loan Class | p. 239 |
| Case Study: The Course Class | p. 243 |
| (Optional) Case Study: The StackOfIntegers Class | p. 245 |
| (Optional GUI) Creating Windows | p. 247 |
| Strings and Text I/O | p. 261 |
| Introduction | p. 262 |
| The String Class | p. 262 |
| The Character Class | p. 270 |
| The StringBuilder/StringBuffer Class | p. 273 |
| Command-Line Arguments | p. 277 |
| (Optional) Regular Expressions | p. 279 |
| The File Class | p. 283 |
| Text I/O | p. 286 |
| (Optional GUI) Containers and Layout Managers | p. 290 |
| Inheritance and Polymorphism | p. 301 |
| Introduction | p. 302 |
| Superclasses and Subclasses | p. 302 |
| Using the super Keyword | p. 307 |
| Overriding Methods | p. 309 |
| Overriding vs. Overloading | p. 310 |
| The Object Class and Its to String() Method | p. 310 |
| Polymorphism, Dynamic Binding, and Generic Programming | p. 311 |
| Casting Objects and the instanceof Operator | p. 313 |
| The ArrayList Class | p. 315 |
| A Custom Stack Class | p. 319 |
| The protected Data and Methods | p. 320 |
| The final Classes, Methods, and Variables | p. 321 |
| (Optional) Methods in the Object Class | p. 322 |
| (Optional) Hiding Data Fields and Static Methods | p. 325 |
| (Optional) Initialization Blocks | p. 327 |
| (Optional GUI) Inheriting GUI Components | p. 330 |
| Abstract Classes and Interfaces | p. 341 |
| Introduction | p. 342 |
| Abstract Classes | p. 342 |
| The Calendar and GregorianCalendar Classes | p. 346 |
| Interfaces | p. 347 |
| Processing Primitive Data Type Values as Objects | p. 356 |
| Automatic Conversion Between Primitive Types and Wrapper Class Types | p. 362 |
| (Optional GUI) Handling GUI Events | p. 363 |
| Object-Oriented Design | p. 371 |
| Introduction | p. 372 |
| The Software Development Process | p. 372 |
| Discovering Class Relationships | p. 373 |
| Case Study: Object-Oriented Design | p. 377 |
| Case Study: The Rational Class | p. 382 |
| Class Design Guidelines | p. 387 |
| (Optional) Modeling Dynamic Behavior Using Sequence Diagrams and Statecharts | p. 390 |
| Framework-Based Programming Using Java API | p. 392 |
| GUI Programming | p. 397 |
| Getting Started with GUI Programming | p. 399 |
| Introduction | p. 400 |
| GUI Components | p. 400 |
| The Java GUI API | p. 401 |
| Frames | p. 403 |
| Layout Managers | p. 406 |
| The Color Class | p. 412 |
| The Font Class | p. 413 |
| Using Panels as Subcontainers | p. 413 |
| Common Features of Swing GUI Components | p. 415 |
| Image Icons | p. 418 |
| Graphics | p. 425 |
| Introduction | p. 426 |
| Graphical Coordinate Systems | p. 426 |
| The Graphics Class | p. 426 |
| The paintComponent Method | p. 429 |
| Drawing Graphics on Panels | p. 430 |
| Drawing Strings, Lines, Rectangles, and Ovals | p. 431 |
| Case Study: The FigurePanel Class | p. 432 |
| Drawing Arcs | p. 436 |
| The Polygon class and Drawing Polygons and Polylines | p. 438 |
| Centering a Display Using the FontMetrics Class | p. 440 |
| Case Study: The MessagePanel Class | p. 442 |
| (Optional) Case Study: The StillClock Class | p. 447 |
| (Optional) Displaying Images | p. 451 |
| (Optional) Case Study: The ImageViewer Class | p. 452 |
| Event-Driven Programming | p. 463 |
| Introduction | p. 464 |
| Event and Event Source | p. 465 |
| Listeners, Registrations, and Handling Events | p. 465 |
| Mouse Events | p. 477 |
| Key Events | p. 479 |
| (Optional) Animation Using the Timer Class | p. 482 |
| Creating User Interfaces | p. 491 |
| Introduction | p. 492 |
| Buttons | p. 492 |
| Check Boxes | p. 498 |
| Radio Buttons | p. 501 |
| Labels | p. 503 |
| Text Fields | p. 504 |
| Text Areas | p. 506 |
| Combo Boxes | p. 509 |
| Lists | p. 512 |
| Scroll Bars | p. 515 |
| Sliders | p. 518 |
| Creating Multiple Windows | p. 521 |
| Applets and Multimedia | p. 535 |
| Introduction | p. 536 |
| The Applet Class | p. 536 |
| The JApplet Class | p. 538 |
| The HTML File and the | p. 539 |
| Enabling Applets to Run as Applications | p. 544 |
| Passing Strings to Applets | p. 546 |
| (Optional) Case Study: TicTacToe | p. 550 |
| (Optional) Case Study: Bouncing Ball | p. 554 |
| (Optional) Locating Resource Using the URL Class | p. 557 |
| (Optional) Playing Audio | p. 559 |
| (Optional) Case Study: Multimedia Animations | p. 560 |
| (Optional) Packaging and Deploying Java Projects | p. 562 |
| Exception Handling, I/O, and Recursion | p. 575 |
| Exceptions and Assertions | p. 577 |
| Introduction | p. 578 |
| Exception-Handling Overview | p. 578 |
| Exceptions and Exception Types | p. 580 |
| Understanding Exception Handling | p. 582 |
| The finally Clause | p. 589 |
| When to Use Exceptions | p. 590 |
| Rethrowing Exceptions | p. 591 |
| (Optional) Chained Exceptions | p. 591 |
| (Optional) Creating Custom Exception Classes | p. 592 |
| (Optional) Assertions | p. 593 |
| Binary I/O | p. 605 |
| Introduction | p. 606 |
| How is I/O Handled in Java? | p. 606 |
| Text I/O vs. Binary I/O | p. 606 |
| Binary I/O Classes | p. 608 |
| Case Study: Copying File | p. 615 |
| Object I/O | p. 617 |
| (Optional) Random Access Files | p. 621 |
| (Optional) Case Study: Address Book | p. 623 |
| Recursion | p. 635 |
| Introduction | p. 636 |
| Example: Factorials | p. 636 |
| Example: Fibonacci Numbers | p. 638 |
| Problem Solving Using Recursion | p. 640 |
| Recursive Helper Methods | p. 641 |
| Tower of Hanoi | p. 643 |
| Fractals | p. 646 |
| Recursion versus Iteration | p. 649 |
| Data Structures | p. 657 |
| Lists, Stacks, Queues, Trees, and Heaps | p. 659 |
| Introduction | p. 660 |
| Lists | p. 660 |
| Stacks and Queues | p. 675 |
| Binary Trees | p. 677 |
| Heaps | p. 683 |
| Priority Queues | p. 688 |
| Generics | p. 693 |
| Introduction | p. 694 |
| Motivations | p. 694 |
| Declaring Generic Classes and Interfaces | p. 695 |
| Generic Methods | p. 698 |
| Raw Type and Backward Compatibility | p. 699 |
| Wildcards | p. 701 |
| Important Facts | p. 703 |
| Avoiding Unsafe Raw Types | p. 703 |
| (Optional) Case Study: Generic Matrix Class | p. 705 |
| Java Collections Framework | p. 713 |
| Introduction | p. 714 |
| The Collection Interface and the AbstractCollection Class | p. 715 |
| Sets | p. 716 |
| The Comparator Interface | p. 721 |
| Lists | p. 723 |
| Static Methods for Lists and Collections | p. 726 |
| The Vector and Stack Classes | p. 729 |
| Queues and Priority Queues | p. 731 |
| (Optional) Maps | p. 733 |
| Singleton and Unmodifiable Collections and Maps | p. 737 |
| Algorithm Efficiency and Sorting | p. 745 |
| Introduction | p. 746 |
| Estimating Algorithm Efficiency | p. 746 |
| Bubble Sort | p. 749 |
| Merge Sort | p. 751 |
| Quick Sort | p. 754 |
| Heap Sort | p. 757 |
| External Sort | p. 761 |
| Concurrency, Networking, and Internationalization | p. 771 |
| Multithreading | p. 773 |
| Introduction | p. 774 |
| Thread Concepts | p. 774 |
| Creating Tasks and Threads | p. 774 |
| The Thread Class | p. 777 |
| Example: Flashing Text | p. 780 |
| GUI Event Dispatcher Thread | p. 781 |
| (Optional) Case Study: Clock with Audio | p. 782 |
| Thread Pools | p. 785 |
| Thread Synchronization | p. 787 |
| (Optional) Synchronization Using Locks | p. 790 |
| (Optional) Cooperation Among Threads | p. 792 |
| (Optional) Case Study: Producer/Consumer | p. 797 |
| (Optional) Blocking Queues | p. 799 |
| (Optional) Semaphores | p. 801 |
| Avoiding Deadlocks | p. 803 |
| Thread States | p. 803 |
| Synchronized Collections | p. 804 |
| (Optional) JProgressBar | p. 805 |
| Networking | p. 815 |
| Introduction | p. 816 |
| Client/Server Computing | p. 816 |
| The InetAddress Class | p. 822 |
| Serving Multiple Clients | p. 823 |
| Applet Clients | p. 826 |
| Sending and Receiving Objects | p. 829 |
| Retrieving Files from Web Servers | p. 834 |
| JEditorPane | p. 836 |
| (Optional) Case Studies: Distributed TicTacToe Games | p. 838 |
| (Optional) Datagram Socket | p. 850 |
| Internationalization | p. 861 |
| Introduction | p. 862 |
| The Locale Class | p. 862 |
| Displaying Date and Time | p. 864 |
| Formatting Numbers | p. 875 |
| (Optional) Resource Bundles | p. 881 |
| (Optional) Character Encoding | p. 888 |
| Advanced GUI Programming | p. 895 |
| JavaBeans and Bean Events | p. 897 |
| Introduction | p. 898 |
| JavaBeans | p. 898 |
| Bean Properties | p. 899 |
| Java Event Model Review | p. 900 |
| Creating Custom Source Components | p. 902 |
| (Optional) Creating Custom Event Sets | p. 906 |
| Containers, Layout Managers, and Borders | p. 917 |
| Introduction | p. 918 |
| Swing Container Structures | p. 918 |
| Layout Managers | p. 920 |
| Creating Custom Layout Managers | p. 938 |
| JScrollPane | p. 943 |
| JTabbedPane | p. 947 |
| JSplitPane | p. 949 |
| Swing Borders | p. 952 |
| (Optional) Pluggable Look-and-Feel | p. 960 |
| Menus, Toolbars, Dialogs, and Internal Frames | p. 967 |
| Introduction | p. 968 |
| Menus | p. 968 |
| Popup Menus | p. 974 |
| JToolBar | p. 976 |
| Processing Actions Using the Action Interface | p. 978 |
| JOptionPane Dialogs | p. 982 |
| Creating Custom Dialogs | p. 989 |
| JColorChooser | p. 992 |
| JFileChooser | p. 994 |
| (Optional) Creating Internal Frames | p. 999 |
| MVC and Swing Models | p. 1007 |
| Introduction | p. 1008 |
| MVC | p. 1008 |
| MVC Variations | p. 1014 |
| Swing Model-View-Controller Architecture | p. 1015 |
| JSpinner | p. 1016 |
| Spinner Models and Editors | p. 1018 |
| JList | p. 1024 |
| List Models | p. 1029 |
| List Cell Renderer | p. 1032 |
| JComboBox | p. 1035 |
| JTable and JTree | p. 1045 |
| Introduction | p. 1046 |
| JTable | p. 1046 |
| Table Models and Table Column Models | p. 1051 |
| Case Study: Modifying Rows and Columns | p. 1055 |
| Table Renderers and Editors | p. 1060 |
| Custom Table Renderers and Editors | p. 1062 |
| Table Model Events | p. 1065 |
| JTree | p. 1068 |
| TreeModel and DefaultTreeModel | p. 1073 |
| TreeNode, MutableTreeNode, and DefaultMutableTreeNode | p. 1074 |
| TreePath and TreeSelectionModel | p. 1077 |
| Case Study: Modifying Trees | p. 1080 |
| Tree Node Rendering and Editing | p. 1084 |
| Tree Events | p. 1085 |
| Web Programming | p. 1091 |
| Java Database Programming | p. 1093 |
| Introduction | p. 1094 |
| Relational Database Systems | p. 1094 |
| SQL | p. 1098 |
| JDBC | p. 1106 |
| PreparedStatement | p. 1113 |
| Retrieving Metadata | p. 1116 |
| Advanced Java Database Programming | p. 1125 |
| Introduction | p. 1126 |
| A Universal SQL Client | p. 1126 |
| Batch Processing | p. 1130 |
| Scrollable and Updateable Result Set | p. 1135 |
| RowSet, JdbcRowSet, and CachedRowSet | p. 1145 |
| Storing and Retrieving Images in JDBC | p. 1150 |
| Servlets | p. 1157 |
| Introduction | p. 1158 |
| HTML and Common Gateway Interface | p. 1158 |
| Creating and Running Servlets | p. 1160 |
| The Servlet API | p. 1164 |
| Creating Servlets | p. 1168 |
| HTML Forms | p. 1170 |
| Database Programming in Servlets | p. 1176 |
| Session Tracking | p. 1180 |
| Sending Images from Servlets | p. 1195 |
| JavaServer Pages | p. 1209 |
| Introduction | p. 1210 |
| A Simple JSP Page | p. 1210 |
| How Is a JSP Page Processed? | p. 1211 |
| JSP Scripting Constructs | p. 1211 |
| Predefined Variables | p. 1213 |
| JSP Directives | p. 1215 |
| Using JavaBeans in JSP | p. 1219 |
| Getting and Setting Properties | p. 1222 |
| Associating Properties with Input Parameters | p. 1223 |
| Forwarding Requests from JavaServer Pages | p. 1232 |
| Case Study: Browsing Database Tables | p. 1232 |
| Remote Method Invocations | p. 1243 |
| Introduction | p. 1244 |
| RMI Basics | p. 1244 |
| Developing RMI Applications | p. 1246 |
| RMI vs. Socket-Level Programming | p. 1252 |
| Developing Three-Tier Applications Using RMI | p. 1253 |
| RMI Callbacks | p. 1255 |
| p. 1269 | |
| Java Keywords | p. 1271 |
| The ASCII Character Set | p. 1272 |
| Operator Precedence Chart | p. 1274 |
| Java Modifiers | p. 1276 |
| Special Floating-Point Values | p. 1278 |
| Bit Operations | p. 1279 |
| Index | p. 1281 |
| Table of Contents provided by Ingram. All Rights Reserved. |