Skip to Content
Learning Java by Building Android Games - Third Edition
book

Learning Java by Building Android Games - Third Edition

by John Horton
March 2021
Beginner to intermediate
686 pages
13h 6m
English
Packt Publishing
Content preview from Learning Java by Building Android Games - Third Edition

Chapter 14: Java Collections, the Stack, the Heap, and the Garbage Collector

In this chapter, we will make a good start with the next project, an authentic-looking clone of the classic Snake game.

It is also time that we understood a little better what is going on underneath the Android hood. We constantly refer to "references," but what exactly is a reference and how does it affect how we build games?

We will cover the following topics in this chapter:

  • Managing memory with the stack, the heap, and the garbage collector
  • An introduction to the Snake game
  • Getting started with the Snake game project

Let's start with the theory part.

Managing and understanding memory

In Chapter 4, Structuring Code with Java Methods, we learned a bit about references. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Java by Building Android Games - Second Edition

Learning Java by Building Android Games - Second Edition

John Horton
Programming Android with Kotlin

Programming Android with Kotlin

Pierre-Olivier Laurence, Amanda Hinchman-Dominguez, Mike Dunn, G. Blake Meike

Publisher Resources

ISBN: 9781800565869Supplemental Content