O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Java Through Games

Book Description

Learning Java Through Games teaches students how to use the different features of the Java language as well as how to program. Suitable for self-study or as part of a two-course introduction to programming, the book covers as much material as possible from the latest Java standard while requiring no previous programming experience.

Taking an application-motivated approach, the text presents an abundance of games. Students must read through the whole chapter to understand all the features that are needed to implement the game. Most chapters start with a description of a game and then introduce different Java constructs for implementing the features of the game on need-to-use bases.

The text teaches students not only how to write code that works but also how to follow good software practices. All sample programs in the text strive to achieve low cohesion and high coupling—the hallmarks of well-designed code. Many programs are refactored multiple times to achieve code that is easy to understand, reuse, and maintain.

The first part of the book covers basic programming techniques, such as conditional statements, loops, methods, arrays, and classes. The second part focuses on more advanced topics, including class inheritance, recursions, sorting algorithms, GUI programming, exception handling, files, and applets.

Table of Contents

  1. Front Cover (1/2)
  2. Front Cover (2/2)
  3. Dedication
  4. Contents (1/2)
  5. Contents (2/2)
  6. Preface
  7. About the Author
  8. List of Figures
  9. List of Tables
  10. Part I - Basic Principles
    1. Chapter 1 - Computer Hardware and Software (1/2)
    2. Chapter 1 - Computer Hardware and Software (2/2)
    3. Chapter 2 - Data Types and Conditional Statements (1/6)
    4. Chapter 2 - Data Types and Conditional Statements (2/6)
    5. Chapter 2 - Data Types and Conditional Statements (3/6)
    6. Chapter 2 - Data Types and Conditional Statements (4/6)
    7. Chapter 2 - Data Types and Conditional Statements (5/6)
    8. Chapter 2 - Data Types and Conditional Statements (6/6)
    9. Chapter 3 - Loops (1/4)
    10. Chapter 3 - Loops (2/4)
    11. Chapter 3 - Loops (3/4)
    12. Chapter 3 - Loops (4/4)
    13. Chapter 4 - Methods and Formatted Output (1/5)
    14. Chapter 4 - Methods and Formatted Output (2/5)
    15. Chapter 4 - Methods and Formatted Output (3/5)
    16. Chapter 4 - Methods and Formatted Output (4/5)
    17. Chapter 4 - Methods and Formatted Output (5/5)
    18. Chapter 5 - Introduction to Arrays (1/6)
    19. Chapter 5 - Introduction to Arrays (2/6)
    20. Chapter 5 - Introduction to Arrays (3/6)
    21. Chapter 5 - Introduction to Arrays (4/6)
    22. Chapter 5 - Introduction to Arrays (5/6)
    23. Chapter 5 - Introduction to Arrays (6/6)
    24. Chapter 6 - Introduction to Classes (1/6)
    25. Chapter 6 - Introduction to Classes (2/6)
    26. Chapter 6 - Introduction to Classes (3/6)
    27. Chapter 6 - Introduction to Classes (4/6)
    28. Chapter 6 - Introduction to Classes (5/6)
    29. Chapter 6 - Introduction to Classes (6/6)
    30. Chapter 7 - The ArrayList Class and the enum Keyword (1/4)
    31. Chapter 7 - The ArrayList Class and the enum Keyword (2/4)
    32. Chapter 7 - The ArrayList Class and the enum Keyword (3/4)
    33. Chapter 7 - The ArrayList Class and the enum Keyword (4/4)
  11. Part II - Advanced Programming Techniques
    1. Chapter 8 - Classes Revisited (1/7)
    2. Chapter 8 - Classes Revisited (2/7)
    3. Chapter 8 - Classes Revisited (3/7)
    4. Chapter 8 - Classes Revisited (4/7)
    5. Chapter 8 - Classes Revisited (5/7)
    6. Chapter 8 - Classes Revisited (6/7)
    7. Chapter 8 - Classes Revisited (7/7)
    8. Chapter 9 - Fun with Swing (1/4)
    9. Chapter 9 - Fun with Swing (2/4)
    10. Chapter 9 - Fun with Swing (3/4)
    11. Chapter 9 - Fun with Swing (4/4)
    12. Chapter 10 - Nested Classes and Event Handling (1/6)
    13. Chapter 10 - Nested Classes and Event Handling (2/6)
    14. Chapter 10 - Nested Classes and Event Handling (3/6)
    15. Chapter 10 - Nested Classes and Event Handling (4/6)
    16. Chapter 10 - Nested Classes and Event Handling (5/6)
    17. Chapter 10 - Nested Classes and Event Handling (6/6)
    18. Chapter 11 - The Breakout Game (Complete Version) (1/6)
    19. Chapter 11 - The Breakout Game (Complete Version) (2/6)
    20. Chapter 11 - The Breakout Game (Complete Version) (3/6)
    21. Chapter 11 - The Breakout Game (Complete Version) (4/6)
    22. Chapter 11 - The Breakout Game (Complete Version) (5/6)
    23. Chapter 11 - The Breakout Game (Complete Version) (6/6)
    24. Chapter 12 - Layout Management and GUI Components (1/6)
    25. Chapter 12 - Layout Management and GUI Components (2/6)
    26. Chapter 12 - Layout Management and GUI Components (3/6)
    27. Chapter 12 - Layout Management and GUI Components (4/6)
    28. Chapter 12 - Layout Management and GUI Components (5/6)
    29. Chapter 12 - Layout Management and GUI Components (6/6)
    30. Chapter 13 - Exception Handling and Files (1/6)
    31. Chapter 13 - Exception Handling and Files (2/6)
    32. Chapter 13 - Exception Handling and Files (3/6)
    33. Chapter 13 - Exception Handling and Files (4/6)
    34. Chapter 13 - Exception Handling and Files (5/6)
    35. Chapter 13 - Exception Handling and Files (6/6)
    36. Chapter 14 - Recursion (1/5)
    37. Chapter 14 - Recursion (2/5)
    38. Chapter 14 - Recursion (3/5)
    39. Chapter 14 - Recursion (4/5)
    40. Chapter 14 - Recursion (5/5)
    41. Chapter 15 - Java Applets (1/4)
    42. Chapter 15 - Java Applets (2/4)
    43. Chapter 15 - Java Applets (3/4)
    44. Chapter 15 - Java Applets (4/4)
  12. Back Cover