Programming with Java -- Solution 1
[Assignment]
Hello, who
Math
Look at Math.java.
Notice how concatenation is used in fmt()
to convert and pad a number to three columns.
Recursion
Look at Fibonacci.java.
In fib()
notice the explicit conversion and how overflow is detected.
Also notice how fmt() is made less dependent
on the situation at hand.
Words of Wisdom
-
object
-
encapsulates a particular state
and knows methods to manipulate it.
-
class
-
contains all objects
that encapsulate the same kind of state
and use exactly the same methods.
-
method
-
procedure specific to a class of objects
that manipulates their state.
-
message
-
method call,
manipulation of the state of the receiving object
with a particular method.