Skip to Main Content

New to Java

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!

Doesn't it return a boolean?

807598Aug 13 2006 — edited Aug 13 2006
Hi,
I get an error message "this method must return a result of type boolean" for the code bellow.
w is an integer (assumed to be 1 or 0) and the loop is supposed to move right along the specified row and look for a sequence of 1s or 0s of length len. If such a sequence is found I want to get true and otherwise false.
		private boolean looking (int rows, int columns, int w, int len) {
			for (int q = 1; q < len + 1; q++){
			if (q == len) return true; 
			if (this.board [rows] [columns + q] != w) return false;}}
I'd appreciate any imput on what the problem is,
Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2006
Added on Aug 13 2006
1 comment
124 views