Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exception in thread "main" java.lang.Error: Unresolved compilation problem

807603Feb 13 2008 — edited Feb 15 2008
The following code:
	public boolean find(MusbachJ_Person person,BstNode node)
	{
		
		//p.l(person);p.l(node.intData);
		if(node.intData.compareTo(person)==0)
		{
			return true;
		}
		
		if( node.leftNode != null ) find(person,node.leftNode );
		if( node.rightNode != null ) find( person, node.rightNode);
        
		else
		{
			return false;
		}
        
        	
	}
returns the following compilation error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
This method must return a result of type boolean

at MusbachJ_TreeNode.find(MusbachJ_TreeNode.java:32)
at MusbachJ_PeopleTree.main(MusbachJ_PeopleTree.java:91)

But I don't understand, the else statement is right there, what more does it want? Thanks! :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2008
Added on Feb 13 2008
9 comments
1,498 views