So I have been tinkering around with Java, and was wondering the difference in the following:
public void insert(Node<T> node) {
//insertion code
}
vs
public TreeNode<T> insert(Node node) {
//insertion code
}
Assuming Node is a class declared:
public class Node<T> {
//member variables
//member functions
}
Both methods compile and achieve the same goal. However, I was wondering if the first method eg. insert(Node<T>
node) is simply more verbose and explicit than insert(Node node).