Anyone have any idea why my constructor isn't initializing? I get no compile errors in my main program when I initialize with the default one which takes no parameters. However if I try to initialize one of the constructors that takes a string, I get the following compiler message:
Program2.java:42: cannot resolve symbol
symbol : constructor TreeNode (java.lang.String)
location: class TreeNode
TreeNode operandNode = new TreeNode(operand);
^
The following is are snippets of code.
You can get my TreeNode class Here and my main program Here
Thanks in advance,
Faisal
Program2.java:42: cannot resolve symbol
symbol : constructor TreeNode (java.lang.String)
location: class TreeNode
TreeNode operandNode = new TreeNode(operand);
^
The following is are snippets of code.
Code:
<B>The default Constructor</B>
class TreeNode
{
private String info;
private TreeNode lc;
private TreeNode rc;
public void TreeNode() // Default Constructor
{
info = "";
rc = null;
lc = null;
System.out.println("Here");
}
.......
You can get my TreeNode class Here and my main program Here
Thanks in advance,
Faisal