The Java training online
Purpose: Write a complete class to describe a simple tree object.
Statement of the exercise:
trainingpackage, 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
dbhin argument, a getter for the
dbhvariable and a
toString()method displaying the tree dbh.
dbh5.6cm and print its
toString()method to the terminal