ENGLISH

Introduction to Programming with Java: A Problem Solving Approach

Book information

Publisher
McGraw-Hill Higher Education
Year
2007
ISBN
0073047023, 9780073047027
Language
english
Format
PDF
Filesize
17 MB (17712550 bytes)
Edition
Para Eua
Pages
848\848
Time added
2020-04-30 16:44:54

Description

This book teaches the reader how to write programs using Java. It does so with a unique approach that combines fundamentals first with objects early. The book transitions smoothly through a carefully selected set of procedural programming fundamentals to object-oriented fundamentals. During this early transition and beyond, the book emphasizes problem solving. For example, Chapter 2 is devoted to algorithm development, Chapter 8 is devoted to program design, and problem-solving sections appear throughout the book. Problem-solving skills are fostered with the help of an interactive, iterative presentation style: Here's the problem. How can we solve it? How can we improve the solution? Some key features include: •A conversational, easy-to-follow writing style. •Many executable code examples that clearly and efficiently illustrate key concepts. •Extensive use of UML class diagrams to specify problem organization. •Simple GUI programming early, in an optional standalone graphics track. •Well-identified alternatives for altering the book's sequence to fit individual needs. •Well-developed projects in six different academic disciplines, with a handy summary. •Detailed customizable PowerPointTM lecture slides, with icon-keyed hidden notes. Student Resources: Links to compiler software - for Sun's Java2 SDK toolkit, Helios's TextPad, Eclipse, NetBeans, and BlueJ. TextPad tutorial. Eclipse tutorials. Textbook errata. All textbook example programs and associated resource files. Instructor Resources: Customizable PowerPoint lecture slides with hidden notes. Hidden notes provide comments that supplement the displayed text in the lecture slides. For example, if the displayed text asks a question the hidden notes provide the answer. Exercise solutions. Project solutions. Supplemental Chapters to Accommodate an Objects-Late Approach are available. Click this link to reach the supplemental chapters. "The authors have done a superb job of organizing the various chapters to allow the students to enjoy programming in Java from day one. I am deeply impressed with the entire textbook. I would have my students keep this text and use it throughout their academic career as an excellent Java programming source book". – Benjamin B. Nystuen, University of Colorado at Colorado Springs "The authors have done a great job in describing the technical aspects of programming. The authors have an immensely readable writing style. I have an extremely favorable impression of Dean and Dean’s proposed text". – Shyamal Mitra, University of Texas at Austin "The overall impression of the book was that it was “friendly” to read. I think this is a great strength, simply because students reading it, and especially students who are prone to reading to understand, will appreciate this approach rather than the regular hardcore programming mentality". – Andree Jacobson, University of New Mexico Title Contents 1 Introduction to Computers and Programming 1.1. Introduction 1.2. Hardware Terminology 1.3. Program Development 1.4. Source Code 1.5. Compiling Source Code into Object Code 1.6. Portability 1.7. Emergence of Java 1.8. First Program—Hello World 1.9. GUI Track: Hello World (Optional) 2 Algorithms and Design 2.1. Introduction 2.2. Output 2.3. Variables 2.4. Operators and Assignment Statements 2.5. Input 2.6. Flow of Control and Flowcharts 2.7. if Statements 2.8. Loops 2.9. Loop Termination Techniques 2.10. Nested Looping 2.11. Tracing 2.12. Other Pseudocode Formats and Applications 2.13. Problem Solving: Asset Management (Optional) 3 Java Basics 3.1. Introduction 3.2. “I Have a Dream” Program 3.3. Comments and Readability 3.4. The Class Heading 3.5. The main Method’s Heading 3.6. Braces 3.7. System.out.println 3.8. Compilation and Execution 3.9. Identifi ers 3.10. Variables 3.11. Assignment Statements 3.12. Initialization Statements 3.13. Numeric Data Types—int, long, float, double 3.14. Constants 3.15. Arithmetic Operators 3.16. Expression Evaluation and Operator Precedence 3.17. More Operators: Increment, Decrement, and Compound Assignment 3.18. Tracing 3.19. Type Casting 3.20. char Type and Escape Sequences 3.21. Primitive Variables Versus Reference Variables 3.22. Strings 3.23. Input—the Scanner Class 3.24. GUI Track: Input and Output with JOptionPane (Optional) 4 Control Statements 4.1. Introduction 4.2. Conditions and Boolean Values 4.3. if Statements 4.4. && Logical Operator 4.5. Logical Operator 4.6. ! Logical Operator 4.7. switch Statement 4.8. while Loop 4.9. do Loop 4.10. for Loop 4.11. Solving the Problem of Which Loop to Use 4.12. Nested Loops 4.13. boolean Variables 4.14. Input Validation 4.15. Problem Solving with Boolean Logic (Optional) 5 Using Pre-Built Methods 5.1. Introduction 5.2. The API Library 5.3. Math Class 5.4. Wrapper Classes for Primitive Types 5.5. Character Class 5.6. String Methods 5.7. Formatted Output with the printf Method 5.8. Problem Solving with Random Numbers (Optional) 5.9. GUI Track: Drawing Images, Lines, Rectangles, and Ovals in Java Applets (Optional) 6 Object-Oriented Programming 6.1. Introduction 6.2. Object-Oriented Programming Overview 6.3. First OOP Class 6.4. Driver Class 6.5. Calling Object, this Reference 6.6. Instance Variables 6.7. Tracing an OOP Program 6.8. UML Class Diagrams 6.9. Local Variables 6.10. The return Statement 6.11. Argument Passing 6.12. Specialized Methods—Accessors, Mutators, Boolean Methods 6.13. Problem Solving with Simulation (Optional) 7 Object-Oriented Programming— Additional Details 7.1. Introduction 7.2. Object Creation—A Detailed Analysis 7.3. Assigning a Reference 7.4. Testing Objects for Equality 7.5. Passing References as Arguments 7.6. Method-Call Chaining 7.7. Overloaded Methods 7.8. Constructors 7.9. Overloaded Constructors 7.10. Problem Solving with Multiple Driven Classes 8 Software Engineering 8.1. Introduction 8.2. Coding-Style Conventions 8.3. Helper Methods 8.4. Encapsulation (With Instance Variables and Local Variables) 8.5. Design Philosophy 8.6. Top-Down Design 8.7. Bottom-Up Design 8.8. Case-Based Design 8.9. Iterative Enhancement 8.10. Merging Driver Method into Driven Class 8.11. Accessing Instance Variables without Using this 8.12. Problem Solving with the API Calendar Class (Optional) 8.13. GUI Track: Problem Solving with CRC Cards (Optional) 9 Classes with Class Members 9.1. Introduction 9.2. Class Variables 9.3. Class Methods 9.4. Named Constants 9.5. Writing Your Own Utility Class 9.6. Using Class Members in Conjunction with Instance Members 9.7. Problem Solving with Class Members and Instance Members in a Linked List Class (Optional) 10 Arrays and ArrayLists 10.1. Introduction 10.2. Array Basics 10.3. Array Declaration and Creation 10.4. Array length Property and Partially Filled Arrays 10.5. Copying an Array 10.6. Problem Solving with Array Case Studies 10.7. Searching an Array 10.8. Sorting an Array 10.9. Two-Dimensional Arrays 10.10. Arrays of Objects 10.11. The ArrayList Class 10.12. Storing Primitives in an ArrayList 10.13. ArrayList Example Using Anonymous Objects and the For-Each Loop 10.14. ArrayLists Versus Standard Arrays 11 Type Details and Alternate Coding Mechanisms 11.1. Introduction 11.2. Integer Types and Floating-Point Types 11.3. char Type and the ASCII Character Set 11.4. Type Conversions 11.5. Prefi x/Postfi x Modes for Increment/Decrement Operators 11.6. Embedded Assignments 11.7. Conditional Operator Expressions 11.8. Expression Evaluation Review 11.9. Short-Circuit Evaluation 11.10. Empty Statement 11.11. break Statement within a Loop 11.12. for Loop Header Details 11.13. GUI Track: Unicode (Optional) 12 Aggregation, Composition, and Inheritance 12.1. Introduction 12.2. Composition and Aggregation 12.3. Inheritance Overview 12.4. Implementation of Person/Employee/ FullTime Hierarchy 12.5. Constructors in a Subclass 12.6. Method Overriding 12.7. Using the Person/Employee/FullTime Hierarchy 12.8. The final Access Modifi er 12.9. Using Inheritance with Aggregation and Composition 12.10. Design Practice with Card Game Example 12.11. Problem Solving with Association Classes (Optional) 13 Inheritance and Polymorphism 13.1. Introduction 13.2. The Object Class and Automatic Type Promotion 13.3. The equals Method 13.4. The toString Method 13.5. Polymorphism and Dynamic Binding 13.6. Assignments Between Classes in a Class Hierarchy 13.7. Polymorphism with Arrays 13.8. Abstract Methods and Classes 13.9. Interfaces 13.10. The protected Access Modifi er 13.11. GUI Track: Three-Dimensional Graphics (Optional) 14 Exception Handling 14.1. Introduction 14.2. Overview of Exceptions and Exception Messages 14.3. Using try and catch Blocks to Handle “Dangerous” Method Calls 14.4. Line Plot Example 14.5. try Block Details 14.6. Two Categories of Exceptions—Checked and Unchecked 14.7. Unchecked Exceptions 14.8. Checked Exceptions 14.9. The Exception Class and Its getMessage Method 14.10. Multiple catch Blocks 14.11. Understanding Exception Messages 14.12. Using throws to Postpone the catch 14.13. GUI Track and Problem Solving: Line Plot Example Revisited (Optional) 15 Files 15.1. Introduction 15.2. Java API Classes You Need to Import 15.3. Text-File Output 15.4. Text-File Input 15.5. HTML File Generator 15.6. Text File Data Format Versus Binary File Data Format 15.7. Binary File I/O 15.8. Object File I/O 15.9. The File Class 15.10. GUI Track: The JFileChooser Class (Optional) 16 GUI Programming Basics 16.1. Introduction 16.2. Event-Driven Programming Basics 16.3. A Simple Window Program 16.4. JFrame Class 16.5. Java Components 16.6. JLabel Component 16.7. JTextField Component 16.8. Greeting Program 16.9. Component Listeners 16.10. Inner Classes 16.11. Anonymous Inner Classes 16.12. JButton Component 16.13. Dialog Boxes and the JOptionPane Class 16.14. Distinguishing Between Multiple Events 16.15. Using getActionCommand to Distinguish Between Multiple Events 16.16. Color 16.17. How GUI Classes Are Grouped Together 16.18. Mouse Listeners and Images (Optional) 17 GUI Programming—Component Layout, Additional GUI Components 17.1. Introduction 17.2. GUI Design and Layout Managers 17.3. Manager FlowLayout 17.4. BorderLayout Manager 17.5. GridLayout Manager 17.6. Tic-Tac-Toe Example 17.7. Problem Solving: Winning at Tic-Tac-Toe (Optional) 17.8. Embedded Layout Managers 17.9. JPanel class 17.10. MathCalculator Program 17.11. JtextArea Component 17.12. JcheckBox Component 17.13. JradioButton Component 17.14. JcomboBox Component 17.15. Job Application Example 17.16. More Swing Components Appendices Appendix 1 Unicode/ASCII Character Set with Hexadecimal Codes Appendix 2 Operator Precedence Appendix 3 Java Reserved Words Appendix 4 Packages Appendix 5 Java Coding-Style Conventions Appendix 6 Javadoc Appendix 7 UML Diagrams Appendix 8 Recursion Appendix 9 Multithreading

Similar books