- Learning Java by
- Learning Java
- Jonathan Knudsen
- Patrick Niemeyer
- Editor
- John Posner
- About O’Reilly
- Support
- International
- Download the O’Reilly App
- Watch on your big screen
- Do not sell my personal information
- Don’t leave empty-handed
- It’s yours, free.
- Check it out now on O’Reilly
- Learning Java by Building Android Games — Third Edition
- Book description
- Key Features
- Book Description
- What you will learn
- Who this book is for
- Learning Java, 5th Edition
- Book description
- Publisher resources
- Table of contents
- Product information
- You might also like
- Check it out now on O’Reilly
- Learning Java, 6th Edition
- Book description
Learning Java by
Get full access to Learning Java and 60K+ other titles, with a free 10-day trial of O’Reilly.
There are also live events, courses curated by job role, and more.
Learning Java
Jonathan Knudsen
Patrick Niemeyer
Editor
John Posner
Copyright © 2000 O’Reilly Media, Inc.
Get Learning Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
About O’Reilly
Support
International
Download the O’Reilly App
Take O’Reilly with you and learn anywhere, anytime on your phone and tablet.
Watch on your big screen
View all O’Reilly videos, Superstream events, and Meet the Expert sessions on your home TV.
Do not sell my personal information
© 2023, O’Reilly Media, Inc. All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
Don’t leave empty-handed
Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.
It’s yours, free.
Check it out now on O’Reilly
Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.
Learning Java by Building Android Games — Third Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
Get ready to learn Java the fun way by developing games for the Android platform with this new and updated third edition
Key Features
- Learn Java, Android, and object-oriented programming from scratch
- Find out how to build games including Sub Hunter, Retro Pong, Bullet Hell, Classic Snake, and Scrolling Shooters
- Create and design your own games by learning all the concepts that a game developer must know
Book Description
Android is one of the most popular mobile operating systems today. It uses the most popular programming language, Java, as one of the primary languages for building apps of all types. Unlike most other Android books, this book doesn’t assume that you have any prior knowledge of Java programming, instead helps you get started with building Android games as a beginner.
This new, improved, and updated third edition of Learning Java by Building Android Games helps you to build Android games from scratch. Once you’ve got to grips with the fundamentals, the difficulty level increases steadily as you explore key Java topics, such as variables, loops, methods, object-oriented programming (OOP), and design patterns while working with up-to-date code and supporting examples. At each stage, you’ll be able to test your understanding by implementing the concepts that you’ve learned to develop a game. Toward the end, you’ll build games such as Sub Hunter, Retro Pong, Bullet Hell, Classic Snake, and Scrolling Shooter.
By the end of this Java book, you’ll not only have a solid understanding of Java and Android basics but will also have developed five cool games for the Android platform.
What you will learn
- Set up a game development environment in Android Studio
- Respond to a player’s touch and program intelligent enemies who can challenge the player in different ways
- Explore collision detection, sprite sheets animation, simple tracking and following, AI, parallax backgrounds, and particle explosions
- Animate objects at 60 FPS and manage multiple independent objects using OOP
- Work with design patterns such as OOP, singleton, strategy, and entity-component
- Work with the Android API, the SoundPool API, Paint, Canvas, Bitmap classes, and detect version numbers
Who this book is for
Learning Java by Building Android Games is for anyone who is new to Java, Android, or game programming and wants to develop Android games. The book will also serve as a refresher for those who already have experience using Java on Android or any other platform but are new to game development.
Learning Java, 5th Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
If you’re new to Java—or new to programming—this best-selling book will guide you through the language features and APIs of Java 11. With fun, compelling, and realistic examples, authors Marc Loy, Patrick Niemeyer, and Daniel Leuck introduce you to Java fundamentals—including its class libraries, programming techniques, and idioms—with an eye toward building real applications.
You’ll learn powerful new ways to manage resources and exceptions in your applications—along with core language features included in recent Java versions.
- Develop with Java, using the compiler, interpreter, and other tools
- Explore Java’s built-in thread facilities and concurrency package
- Learn text processing and the powerful regular expressions API
- Write advanced networked or web-based applications and services
Publisher resources
Table of contents
- Preface
- Who Should Read This Book
- New Developments
- New in This Edition (Java 11, 12, 13, 14)
- Enter Java
- Java’s Origins
- Growing Up
- Simplify, Simplify, Simplify…
- Type Safety and Method Binding
- Incremental Development
- Dynamic Memory Management
- Error Handling
- Threads
- Scalability
- The Verifier
- Class Loaders
- Security Managers
- The Past: Java 1.0–Java 11
- The Present: Java 14
- The Future
- Availability
- Java Tools and Environment
- Installing the JDK
- Installing OpenJDK on Linux
- Installing OpenJDK on macOS
- Installing OpenJDK on Windows
- Configuring IntelliJ IDEA and Creating a Project
- Running the Project
- Grabbing the Learning Java Examples
- Classes
- The main() Method
- Classes and Objects
- Variables and Class Types
- HelloComponent
- Inheritance
- The JComponent Class
- Relationships and Finger-Pointing
- Package and Imports
- The paintComponent() Method
- Instance Variables
- Constructors
- Events
- The repaint() Method
- Interfaces
- JDK Environment
- The Java VM
- Running Java Applications
- System Properties
- javap
- Modules
- File Compression
- The jar Utility
- The pack200 Utility
- Text Encoding
- Comments
- Javadoc Comments
- Primitive Types
- Reference Types
- Inferring Types
- Passing References
- A Word About Strings
- Statements
- Expressions
- Array Types
- Array Creation and Initialization
- Using Arrays
- Anonymous Arrays
- Multidimensional Arrays
- Classes
- Declaring and Instantiating Classes
- Accessing Fields and Methods
- Static Members
- Local Variables
- Shadowing
- Static Methods
- Initializing Local Variables
- Argument Passing and References
- Wrappers for Primitive Types
- Method Overloading
- Constructors
- Working with Overloaded Constructors
- Garbage Collection
- Importing Classes
- Custom Packages
- Member Visibility and Access
- Compiling with Packages
- Subclassing and Inheritance
- Interfaces
- Inner Classes
- Anonymous Inner Classes
- Exceptions
- Exceptions and Error Classes
- Exception Handling
- Bubbling Up
- Stack Traces
- Checked and Unchecked Exceptions
- Throwing Exceptions
- try Creep
- The finally Clause
- try with Resources
- Performance Issues
- Enabling and Disabling Assertions
- Using Assertions
- Overview
- Logging Levels
- A Simple Example
- Logging Setup Properties
- The Logger
- Performance
- Collections
- The Collection Interface
- Collection Types
- The Map Interface
- Containers: Building a Better Mousetrap
- Can Containers Be Fixed?
- Talking About Types
- Erasure
- Raw Types
- Why Isn’t a List a List?
- Converting Between Collections and Arrays
- Iterator
- Strings
- Constructing Strings
- Strings from Things
- Comparing Strings
- Searching
- String Method Summary
- Parsing Primitive Numbers
- Tokenizing Text
- Regex Notation
- The java.util.regex API
- The java.lang.Math Class
- Big/Precise Numbers
- Local Dates and Times
- Comparing and Manipulating Dates and Times
- Time Zones
- Parsing and Formatting Dates and Times
- Parsing Errors
- Timestamps
- Introducing Threads
- The Thread Class and the Runnable Interface
- Controlling Threads
- Death of a Thread
- Serializing Access to Methods
- Accessing Class and Instance Variables from Multiple Threads
- Thread State
- Time-Slicing
- Priorities
- Yielding
- The Cost of Synchronization
- Thread Resource Consumption
- Buttons and Sliders and Text Fields, Oh My!
- Component Hierarchies
- Model View Controller Architecture
- Labels and Buttons
- Text Components
- Other Components
- Frames and Windows
- JPanel
- Layout Managers
- Mouse Events
- Action Events
- Change Events
- Other Events
- Message Dialogs
- Confirmation Dialogs
- Input Dialogs
- SwingUtilities and Component Updates
- Timers
- Menus
- Preferences
- Custom Components and Java2D
- JavaFX
- Streams
- Basic I/O
- Character Streams
- Stream Wrappers
- The java.io.File Class
- File Streams
- RandomAccessFile
- FileSystem and Path
- NIO File Operations
- Asynchronous I/O
- Performance
- Mapped and Locked Files
- Channels
- Buffers
- Character Encoders and Decoders
- FileChannel
- Clients and Servers
- The DateAtHost Client
- A Distributed Game
- Uniform Resource Locators
- The URL Class
- Stream Data
- Getting the Content as an Object
- Managing Connections
- Handlers in Practice
- Useful Handler Frameworks
- Using the GET Method
- Using the POST Method
- The HttpURLConnection
- SSL and Secure Web Communications
- The Servlet Life Cycle
- Servlets
- The HelloClient Servlet
- The Servlet Response
- Servlet Parameters
- The ShowParameters Servlet
- User Session Management
- The ShowSession Servlet
- Configuration with web.xml and Annotations
- URL Pattern Mappings
- Deploying HelloClient
- Java Releases
- JCP and JSRs
- Retrofitting Your Code
- Grabbing the Main Code Examples
- Installing IntelliJ IDEA
- Installing on Linux
- Installing on a macOS
- Installing on Windows
Product information
- Title: Learning Java, 5th Edition
- Author(s): Marc Loy, Patrick Niemeyer, Daniel Leuck
- Release date: March 2020
- Publisher(s): O’Reilly Media, Inc.
- ISBN: 9781492056270
You might also like
Check it out now on O’Reilly
Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.
Learning Java, 6th Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
Ideal for working programmers new to Java, this best-selling book guides you through the language features and APIs of Java 21. Through fun, compelling, and realistic examples, author Marc Loy introduces you to Java fundamentals, including its class libraries, programming techniques, and idioms, with an eye toward building real applications.
This updated sixth edition expands the content to cover lambdas and streams, and shows you how to use a functional paradigm in Java. You’ll learn about the latest Java features introduced since the book’s fifth edition, from JDK 15 through 21. You’ll also take a deep dive into the virtual threads introduced as Project Loom in Java 19 and become familiar with the public release of JDK 21 LTS.
- Learn the structure of the Java language and Java applications
- Write, compile, and execute Java applications
- Understand the basics of Java threading and concurrent programming
- Learn Java I/O basics, including local files and network resources
- Create compelling interfaces with an eye toward usability
- Learn how functional features have been integrated in Java
- Keep up with Java developments as new versions are released