if (current.leftChild.iData != '+' && current.rightChild.iData != '+')
For this line of code i am trying to check if the leftChild of the current node and the rightChild of the current node both == ‘+’ Or character plus sign. If either of them do not = the character + i want to execute other code. I am getting a null pointer exception for this line and the method i use to call this line of code.
iData is just the information inside the node.
If you are getting a null pointer exception that means either the following cases.
1. current is null.
2. leftChild is null/ rightChild is null.
3. iData is null
But since you haven’t provided a lot of details. I won’t be able to help you.