If we treat tree as an object then what will be its leaf and branches?
Similarly, if we treat dog as an object then what will be its legs,mouth and eyes?
A tree HAS a set of branches. Each branch HAS a set of leaves.
That is, (pseudocode)
class Tree {
Branch[] branches;
}
class Branch {
Leaf[] leaves;
}
class Leaf {
}
Similarly with the dog: a dog HAS a collection of eyes; it also has a collection of legs; and it has a mouth.
class Dog {
Leg[] legs;
Mouth mouth;
Eye[] eyes;
}