This is a repo consisting of the programs as featured in the course book Introduction to Java Programming and Data Structures by Y. Daniel Liang. As per usual the "during-chapter" programs will be found with descriptive file names and the "after-chapter" programming exercises, referred to as "section" in the course book will be featured in the list beneath the Objectives-list with descriptive names and hyperlinks to its respective GitHub URL instead.
Objectives
- To describe objects and classes, and use classes to model objects
- To use UML graphical notation to describe classes and objects
- To demonstrate how to define classes and create objects
- To create objects using constructors
- To define a reference variable using a reference type and access objects via object reference variables
- To access an object's data and methods using the object member access operator (.)
- To define data fields of reference types and assign default values for an object's data fields
- To distinguish between object reference variables and primitive-data-type variables
- To use the Java librery classes
Date,Random, andPont2D- To distinguish between instance and static variables and methods
- To define private data fields wit appropriate getter and setter methods
- To encapsulate data fields to make classes easy to maintain
- To develop methods with object arguments and differentiate between primitive-type arguments and object-type arguments
- To store and process objects in arrays
- To create immutable objects from immutable classes to protect the contents of the objects
- To determine the scope of variables in the context of a class
- To use the keyword
thisto refer to the calling object itself Liang, 2020, p. 3451
The section classes are programming exercises. These come after each chapter instead of during the chapters as the listing classes does. * and ** denotes heightened difficulty according to the course book editors.
(To come..)
- 9.1 The
Rectangleclass

- 9.2 The
Stockclass
- 9.2b Test Class for 9.2
- 9.3 Use the
Dateclass - 9.4 Use the
Randomclass - 9.5 Use the
GregorianCalendarclass - 9.6 Stopwatch
- 9.6b Test Class for 9.6
- 9.7 The
Accountclass
- 9.7b Test Class for 9.7
- 9.8 The
Fanclass
- 9.8b Test Class for 9.8
- 9.9 Geometry: n-sided regular polygon
- 9.9b Test Class for 9.9
- 9.10 Algebra: quadratic equations
- 9.10b Test Class for 9.19
- 9.11 Algebra: 2 * 2 linear equations
- 9.11b Test Class for 9.11
- 9.12 Geometry: intersecting point
- 9.13 The
Locationclass
Additional tasks...
- There are no `Comprehensive` tasks in Chapter 9. 📖
- 9.1 TestCircle
- 9.2 Circle (AlternativeCircle)
- 9.3 TV
- 9.4 TestTV
- 9.5 TestPoint2D
- 9.6 Circle (for CircleWithStaticMembers)
- 9.7 TestCircleWithStaticMembers
- 9.8 Circle (for CircleWithPrivateDataFields)
- 9.9 TestCircleWithPrivateDataFields
- 9.10 TestPassObject
- 9.11 TotalArea
Footnotes
-
Liang, Y. D. (2020). Introduction to Java Programming and Data Structures (12th ed.). Pearson Education. ↩