Java is everywhere
The core Java fundamentals that we are about to learn apply when working within classes that we inherit from (such as AppCompatActivity
), as well as classes that we write ourselves (as we will start to do in Chapter 10, Object-Oriented Programming).
As it is more logical to learn the basics before we write our own classes, we will be using an extended Activity
class, AppCompatActivity
, to add some Java code in a mini project. We will use the Log
and Toast
classes again to see the results of our coding in the overridden onCreate
method of the Activity
class, to trigger the execution of our code.
When however, we move on to Chapter 10, Object-Oriented Programming and start to write our own classes, as well as understand more about how classes written by others work, everything we have learned here will apply then too—in fact, all the Java that you learn in this chapter and the next will apply, if you strip it out of the Activity
class and paste it into...