A Bowl HAS-A Snake.
The Bowl also has a temperature.
The Snake rises to random heights depending on the temperature of the Bowl.
The maximum height the snake can rise to is 120cm - this can never change.
If the Snake can rise to this maximum height it means that the Bowl temperature is very high and the Bowl cracks and the Snake escapes.
is an abstraction of a Snake.
is an abstraction of a Bowl.
Redesign the classes using as many modifiers as you can.
Write a main program based on the scenarion described above.
In your design, use as many modifiers as you can!
Can you find a way to include an attribute which uses the static modifier in any of the classes (see video)?
make sure your classes are all contained in a package, including your Main class.
We have become very familar with 2 modifiers in Java that can be applied to both methods and attributes of a class:
There are 3 other modifiers that are useful to be familiar with when programming in Java:
Complete the Worksheet followed by the coding activity.
public
private
protected
final
static
package
class
object (instance of a class)
abstraction