The Java training online
Purpose: Write a complete class to describe a simple tree object.
Statement of the exercise:
training
package, the class is named Tree
, with a single instance variable named dbh
, in centimeters (diameter at breast height is the main dimension of a tree for foresters). Add a constructor taking dbh
in argument, a getter for the dbh
variable and a toString()
method displaying the tree dbh.dbh
5.6cm and print its toString()
method to the terminal