Chapter 2: Java – First Contact
In this chapter, we will make significant progress with the Sub' Hunter game even though this is our first lesson on Java. We will explore, in detail, exactly how Sub' Hunter will be played and the steps/flow that our completed code will need to take to implement the game.
We will also learn about how Java uses code comments to document the code, take a brief initial glimpse at methods to structure our code, and an even briefer first glimpse at Object-Oriented Programming (OOP), which will begin to reveal the power of Java and the Android API.
The autogenerated code that we referred to in Chapter 1, Java, Android, and Game Development, will also be explained as we proceed and add more code. In this chapter, we will cover the following topics:
- Planning the Sub' Hunter game
- Introducing Java methods
- Structuring Sub' Hunter with methods
- Introducing OOP
- Using Java packages
- Linking up the Sub' Hunter methods
First, let's do some planning.