The Java training online
Try to work with the helping elements before looking at the solution…
Helping elements
training
matching its package namedbh
instance variable should be private
and double
Tree
and no return typethis.dbh = dbh
(this.dbh is the instance variable and dbh is the method parameter)dbh
is a method called getDbh()
, it is public and returns dbh
Tree
, use new Tree (…)
and pass the expected argumentt1
is a reference to a Tree object, System.out.println (t1.toString ())
or System.out.println (“” + t1)
print the result of its toString()
method to the terminaljavac training/*.java
A possible solution