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

Java 7 for Absolute Beginners

Book Description

Java 7 Programming for Absolute Beginners introduces the new core, open source Java Development Kit. Its focus is on practical knowledge and its completeness—it provides all the bits and pieces an utter novice needs to get started programming in Java.

It seems as if everyone is writing applications or apps these days for Android, BlackBerry, and the enterprise—it's where the money's at. But, how do they do it? Well, it's best to start by learning Java, one of the most popular programming languages around these days, still. Yes, that's right.

This book:

  • Teaches Java development in language anyone can understand, giving you the best possible start

  • Provides simple, step-by-step examples that make learning easy, allowing you to pick up the concepts without fuss

  • Offers clear code descriptions and layout so that you can get your code running as soon as possible

What you'll learn

  • How a computer processes programs

  • Write a program in Java

  • Debug a program

  • Choose and manipulate the data structures that best match your purpose

  • Create a user interface in Java

  • How to do animation in a Java program

  • Advanced topics such as thread management and recursion that any programmer will soon need

Who this book is for

Everyone! This book is for anyone who wants to learn to develop applications or apps for the enterprise or mobile using Android or BlackBerry and much more. No previous programming experience is necessary.

Table of Contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. Foreword
  6. About the Author
  7. About the Technical Reviewer
  8. Acknowledgments
  9. Introduction
    1. Who This Book Is For
    2. How This Book Is Structured
    3. Conventions
    4. Prerequisites
  10. Chapter 1: Writing Your First Java Program
    1. Installing the JDK
    2. Installing Eclipse
    3. Creating Your First Project
    4. Creating the Program
    5. Summary
  11. Chapter 2: Java Syntax
    1. An Example
    2. Summary
  12. Chapter 3: Data Types
    1. Primitive Data Types
    2. Wrapper Classes
    3. Arrays
    4. The Non-Existent Type: null
    5. Enumerations
    6. Summary
  13. Chapter 4: Operators
    1. Comparing and Sorting Objects
    2. Summary
  14. Chapter 5: Control Flow, Looping, and Branching
    1. Control Flow
    2. Looping
    3. Branching
    4. Summary
  15. Chapter 6: Object-oriented Programming
    1. Objects
    2. Encapsulation
    3. Inheritance
    4. Polymorphism
    5. Our Animals in Java
    6. A Lesson about Granularity
    7. Pass-by-Reference and Pass-by-Value
    8. Summary
  16. Chapter 7: Writing a User Interface
    1. Java Swing: The Basics
    2. A Larger Swing Application
    3. Summary
  17. Chapter 8: Writing and Reading Files
    1. Working with File Objects
    2. Writing and Reading Content
    3. Summary
  18. Chapter 9: Writing and Reading XML
    1. The Structure of XML
    2. XML and Streams
    3. DOM and SAX
    4. Writing XML
    5. Reading XML
    6. A Word about Factory Classes
    7. Summary
  19. Chapter 10: Animation
    1. Timing Is Everything
    2. Animation: A Simple Example
    3. Animating Multiple Items
    4. Sprite Animation
    5. Summary
  20. Chapter 11: Debugging with Eclipse
    1. The Flow of Debugging
    2. Debugging without a Debugger
    3. Starting the Eclipse Debugger
    4. Breakpoints and Variables
    5. Debugging Tips and Tricks
    6. Fixing the Fireworks Program
    7. Summary
  21. Chapter 12: Video Games
    1. The Mechanics of a Video Game
    2. The TargetClick Game
    3. The Shooting Gallery Game
    4. Game Design Resources
    5. Summary
  22. Chapter 13: Garbage Collection
    1. Understanding Memory Allocation
    2. Understanding Garbage Collection
    3. Optimizing Garbage Collection
    4. Collection Hints
    5. Blocking Garbage Collection
    6. A New Garbage Collector
    7. Summary
  23. Chapter 14: Recursion
    1. Recursion is Natural
    2. Recursion is Common
    3. Know Your Stop Condition
    4. When to Avoid Recursion
    5. When to Use Recursion
    6. Calculating the Fibonacci Sequence
    7. Calculating Fractals
    8. Summary
  24. Chapter 15: Generics and Regular Expressions
    1. Generics
    2. Regular Expressions
    3. Summary
  25. Index