- To solve a problem, a
program needs
information
- Information can be obtained
directly by
accessing the variable
directly:
Explanation:
- In this example, the programs
solveProbSol1(),
solveA1() and
solveB1()
obtain the information
direct by
accessing the
variables (e.g., using p.z)
|
- Information can also
be obtained
indirectly
through the use
of method invocations
that return the
desired information:
Explanation:
- In this example, the programs
solveProbSol1(),
solveA1() and
solveB1()
obtain the information
indirect by
invoking the
methods getInfo1(),
getInfo2() and putInfo1()
that
manage the information stored
variables
|
|