4._add_instance_variables_in_the_tree
The Java training online
4. Add instance variables in the tree
Purpose: Think and find where new instance variables should be added in an inheritance graph
Statement of the exercise:
- Add 3 instances variables in the tree classes:
int id
,int age
anddouble height
(m). Add getters for them 3, no setters required here. - Add code in the main method of exercise 1. to create a
SpatializedTree
withid = 2
,age = 6
,height = 6.7m
,dbh= 6.1cm
and location(4, 3)
, then print its toString() method to the terminal
4._add_instance_variables_in_the_tree.txt ยท Last modified: 2021/12/13 09:28 by 127.0.0.1