The Java training online
Purpose: Explore the class inheritance relationship
Statement of the exercise:
SpatializedTree
. This class adds two instance variables called x
and y
, the position of the tree. Write a constructor taking 3 parameters: dbh
, x
and y
. Add a setter for x
and y
, and a getter for each of them. Propose a toString ()
method to display dbh
, x
and y
.