- STAFF PICKS
- GIFTS + GIFT CARDS
- SELL BOOKS
- FIND A STORE
This item may be
Check for Availability
Other titles in the Charles River Media Programming series:
Learning Java Through Applications: A Graphical Approach (Charles River Media Programming)
Synopses & Reviews
Learning Java Through Applications emphasizes Java's graphical capabilities and the ability to create graphical user interfaces. The book uses 15 complete Java programs in order of increasing complexity, including geometric patterns, games, puzzles, number theory problems, and cryptography, to teach students the Java programming language and concepts. New features of Java 5.0 are covered in detail, including enumerated types, "for-each" statements, generics, autoboxing, and static imports. Each chapter contains a capstone program that involves graphics and illustrates the language features introduced in that chapter. The specifications for the program are discussed first, followed by the code and its explanatory text emphasizing the programming techniques used. Because complete programs are included, programmers have the opportunity to explore the design choices involved. Additionally, UML diagrams are included when appropriate to help them understand the overall design of each example.
Book News Annotation:
Jarc (computer science, University of Maryland) takes a slightly different approach to teaching Java by introducing applets for graphical output before diving into objects and applications. Also appropriate for self-study, the beginning textbook covers primitive variables, methods, selection, iteration, arrays, strings, class relationships, and exceptions. The CD-ROM contains Java source code, files for applets, and input files for the programs.
Annotation ©2005 Book News, Inc., Portland, OR (booknews.com)
Book News Annotation:
Jarc (computer science, University of Maryland) takes a slightly different approach to teaching Java by introducing applets for graphical output before diving into objects and applications. Also appropriate for self-study, the beginning textbook covers primitive variables, methods, selection, iteration, arrays, strings, class relationships, and exceptions. The CD-ROM contains Java source code, files for applets, and input files for the programs. Annotation Â©2005 Book News, Inc., Portland, OR (booknews.com)
Teaching programmers how to master Java, this book uses complete graphical programs such as games, geometric patterns, and puzzles as examples that illustrate various Java language features. The companion CD-ROM includes all the source code from the projects.
About the Author
Duane J. Jarc (Alexandria, VA) has a Doctor of Science degree in computer science from The George Washington University and is a professor of computer science at the University of Maryland-University College. He has published several journal articles on programming.
Table of Contents
1 An Overview of Programming Languages and an Introduction to Java Java and the Web Programs, Programming Languages, and Programmers Categories of Programming Languages The Role of the Programmer Syntax and Semantics Comparing English Syntax with Programming Language Syntax The Syntax Levels of Languages Semantics Constant Declarations and Method Calls Constant Declarations Method Calls Graphical Output Several Simple Graphics Methods Our First Java Applet Program Development Editors, Compilers, and Interpreters Command-line or Integrated Development Environments The Development Process The Mechanics of Compiling and Running Applets Programming Exercises Programming Projects 2 Variable Declarations, Assignments, and Expressions Random Input Simple Computation in Java Real Number Data Types Variables and Constants Arithmetic Operators Translating Mathematical Formulas to Java Expressions Type Coercion and Type Casting More on Methods Calling Class versus Instance Methods Calling Void versus Value-Returning Methods The Math Class Two Additional Graphics Methods Assignments The Syntax and Semantics of Assignments Type Coercion and Casting in Assignments An Applet that Draws a Square Inside a Circle 3 Methods, Instance Variables, Scope, and Lifetime Comparing Instance Data with Local Data viii Learning Java Through Applications: A Graphical Approach Scope Rules Access Modifiers Loose Coupling Data Lifetime More on Methods Choosing Between Public and Private Methods Determining the Signature of a Method Some Additional Predefined Methods More Details on Operators and Statements The Shortcut Assignment Operators Calling Another Method in the Same Class The return Statement An Applet that Draws a Triangle Inside a Circle 4 Discrete Selection and Iteration Characters and Strings Single Character Data Multi-Character Data Enumerated Types Keyboard Input Discrete Selection Discrete Types The Syntax and Semantics of the switch Statement An Example Using an Enumerated Type and the switch Statement Choosing Test Data Discrete Iteration The Syntax and Semantics of the for Statement The Standalone Increment and Decrement Operators Compound Statements The Scope and Lifetime of the Loop Control Variable More Details on the Scope of Local Variables An Example Using an Enumerated Type and switch and for Statements An Example Using a for Loop Across a Discrete Range of Integers Nested for Statements An Example Using an Enumerated Type and Nested for Statements The Checkerboard Applet 5 Objects and Primitive Data Comparing Applications and Applets Constructors and Object Creation 1 Comparing Object and Primitive Data Allocation Shadowing Instance Variables 1 Constructors Class Methods Converting an Applet to an Application Enumerated Types with Constructors Shallow versus Deep Copying Mutable and Immutable Objects Object Parameters Object Lifetime and Garbage Collection More on Graphics The Multiple Polygon Application UML Class More on the Mechanics of Compiling and Running Programs x Learning Java Through Applications: A Graphical Approach 6 General Selection and Iteration The Boolean Data Type and Logical Expressions Relational Operators Logical Operators Operator Precedence Associativity General Selection The if Statement Nested if Statements The Conditional Expression Operator General Iteration The while Statement The do-while Statement Applying DeMorgans Laws The for Statement Revisited The break Statement Inside Loops The continue Statement Structured Programming Structured Programs Have Simple Flowcharts The Labeled break Statement More on Graphics Rectangle Objects Color Mixing The Matchbook Application 7 One Dimensional Arrays and Class Invariants Class Constants Declaring Class Data Accessing Class and Instance Constants Lifetime of Class Constants Array Basics Array Declarations Array Subscripts Arrays and for Loops Array Constants An Application that Draws a Square Spiral The Increment and Decrement Operators Revisited Comparing the Meaning of the Prefix and Postfix Operators The Prefix and Postfix Forms in the for Statement The Prefix and Postfix Forms on Array Subscripts An Application to Find the nth Prime Number The Prefix and Postfix Forms on Subscripted Arrays Array Parameters Sorting The Selection Sort The Insertion Sort Physical and Logical Sorts Arrays of Objects Creating Arrays of Objects Object Array Constants An Application That Determines the Mean and Median Arrays of Objects in Place of Parallel Arrays Class Invariants The Invariant for a Grade Record The Invariant for a Generalized Rectangle The Cyclic Quadrilateral Application xii Learning Java Through Applications: A Graphical Approach 8 Generics and Interfaces Unbounded Arrays An Unbounded Integer Array An Integer Reversal Application Generics Wrapper Classes Autoboxing and Unboxing An Example Using a Wrapper as A Generic Argument Interfaces Mouse Event Handling Inner Classes Iterators The Iterator and Iterable Interfaces The IterableArray Class An Application for Testing IterableArray Java Collection Classes Some Methods in the ArrayList Class The Round Spiral Application 9 Strings Extracting Characters From Strings Some Additional String Methods A Character Frequency Application Subdividing Strings Finding Delimiters and Extracting Substrings The StringTokenizer Class The split Method Input Files Pattern Matching Mutable Strings Graphics Definition File Application 10 Composition Relationships Determining Class Relationships Compositional Relationships A Window of Rectangles Application 3 UML Diagrams Depicting Compositional Relationships Document Index Application Class Variables Initializing Class Variables Importing Class Data and Methods Perfect Squares as the Sum of Consecutive Triangle Numbers Tiled Window Application 11 Exceptions and Input/Output Catching Exceptions Predefined Exceptions Checked and Unchecked Exceptions The try Statement Converting Strings to Integers Designating Checked Exceptions as Not Caught 361 Exception Propagation Preconditions and Postconditions The InputOutput Class xiv Learning Java Through Applications: A Graphical Approach File Input/Output Opening, Reading, and Closing Input Files Opening, Writing, and Closing Output Files A Batch Processing The InputFile Class Defining and Throwing Exceptions A Cryptography Example Command-line Input/Output Command-line Arguments Command-line Output Command-line Input The Cryptography Example Again Other Input/Output Topics The StreamTokenizer Class Object Serialization Graphics Serialization Example 12 Generalization and Aggregation Relationships Generalization Relationships Extending the JApplet and Application Classes Inheritance Hierarchies and Type Compatibility Extending the Representation Extending the Specification UML Diagrams Depicting Generalization Relationships Class-Interface Relationships Implementing Interfaces Representation Relationships UML Diagrams Depicting Implementation Relationships Problems with Using Inheritance for Representation Relationships Downcasts and Class Cast Exceptions Aggregation Relationships UML Diagrams Depicting Aggregation Relationships 13 Multidimensional Arrays and GUIs Multidimensional Arrays Two-Dimensional Array Iterations Ragged Arrays Introduction to Developing GUIs Frames and Panels The Application and GraphicsApplication Classes Labels and Borders Layout Managers The 14-15 Puzzle Nonmodal Input Text Fields Buttons A Calculator Program Wrapper Classes that Wrap Methods Named Local Inner Classes Anonymous Local Inner Classes Magic Square Application xvi Learning Java Through Applications: A Graphical Approach 14 Abstract Enumerated Types and Classes Abstract Enumerated Types Another Implementation of the Colored-Circles Application Another Implementation of the Calculator Abstract Classes and Methods An Application Containing Radial Shapes The Matrix Iterator Implemented as an Abstract Class Choosing Between Abstract Enumerated Types and Classes Singleton Objects An Example Containing a Singleton More GUI Features Radio Buttons Frame Menus Mixing Painted Components with Other GUI Components Card Game of War Application 15 Recursive Control Structures Comparing Iteration and Recursion A Framework for Displaying the Terms of a Number Sequence The Sequence of Perfect Squares The Sequence of Fibonacci Numbers Problems Requiring Unbounded Memory Recursion and Nested Structures Prefix Expressions A Program That Evaluates Prefix Expressions Backtracking Maze Search Application 16 Recursive Data Structures Singly Recursive Graphic Objects Linked Lists Reversing Lines with a Linked List A Generic Linked List Class Doubly Recursive Graphic Images Arithmetic Expression Tree Application Appendix A Answers to the Review Questions Appendix B About the CD-ROM Index xviii Learning Java Through Applications: A Graphical Approach
What Our Readers Are Saying