A (175)

(Tuis.) #1
CHAPTER 5: Introduction to Java: Objects, Methods, Classes, and Interfaces 165

You learned about the various versions of Java used for enterprise, client, and mobile application
development, and about OOP. You learned about the java.lang.Object that is the foundation of OOP
and about how Java objects can define attributes, characteristics, states, and behaviors that allow
Java programmers to mimic real-world objects in our “virtual” software development environment.


Then you learned about all the various components of Java programming structures, such as
methods, constants, variables, classes, public interfaces, and constructor methods. You learned
about the Java concept of inheritance, and how to use the new keyword to instantiate an instance of
a Java object using a constructor method call.


Then you looked at the higher-level Java organization constructs called packages and how the total
collection of packages in a programming language forms the API for the language.


Next, you looked at some of the data type specifiers and access control modifiers as well as the
more complex non-access modifiers, and after that you were finally ready to design your first Java
class, called Galaxy, to create Galaxy objects for your HelloUniverse Android application.


You designed the entire Galaxy class, including seven instance variables, one constructor method,
and eight methods to get and set various attributes of the Galaxy object. Once this design was
accomplished, you coded the variable declarations, constructor method, and the functional methods
for the class, and then you typed them into Eclipse and compiled and ran the application to make
sure everything was compiling and would run, meaning there were no code errors introduced.


In Chapter 6, you will start to learn about how Android handles the device display screen by using
the Android View class, and all about the foundation of user interface design as it relates to the
Android OS.

Free download pdf