Dustin Schreader wrote:I'm getting an error on line 243 "setLeft(TreeNode) in TreeNode cannot be applied to (ExprTree)" From what I understand What is sent in the parameter for setLeft method should be of type TreeNode so am I incorrect in thinking that I can call the constructor from within the same class to create a new node of type TreeNode?
Well, yes. You don't need me to tell you that an ExprTree isn't a TreeNode -- the compiler has already told you that. So yes, you're incorrect, calling the ExprTree constructor doesn't result in an object of type TreeNode. It results in an ExprTree object, of course.
Its hard to know the complete logic of your program with this code, it would be better if you can post the code of setLeft(TreeNode) method
or may be an explanation of your Treenode class.
what i understand from this code is that you should pass the ROOT object that you are creating to the setLeft() method instead of Exptree object.