"type mismatch, can not convert from LLNode<E> to E" i
Norm Radder wrote:
"type mismatch, can not convert from LLNode<E> to E" i
Can you post the full text of the error message that shows what source line it was on and what the line number is for that source line?
Stephan van Hulst wrote:Well, the error message says it all really. Your get() method has to return an E, but matchingNode is an LLNode<E>.
I want to return a node
Norm Radder wrote:
I want to return a node
The comments for the get method say: Get the element at position index / That would be E not a Node.
If you want to return a Node, you need a new method with a definition like this:
Norm Radder wrote:That will work if all the nodes have the save data. The code returns the data for the first node (line 9), not the ith node.
It needs to get and return the data for the ith node.
Norm Radder wrote:That will work if all the nodes have the save data. The code returns the data for the first node (line 9), not the ith node.
It needs to get and return the data for the ith node.
Norm Radder wrote:When the code gets to the ith node, return its data.
No need to get the data for any other node.
Do you have a testing program? What happens when you execute it?
Don't get me started about those stupid light bulbs. |