| Author |
still this code gives compile time error
|
vijayreddy patil
Greenhorn
Joined: Feb 12, 2008
Posts: 5
|
|
public class SimpleDotCom { int [] locationCells; int numOfHits = 0; public void setLocationCells(int [] locs) { locationCells = locs; } public String checkYourself(String stringGuess) { int guess = Integer.parseInt(stringGuess); String result = "miss"; for (int cell : locationCells) { if (guess == cell) { result = "hit"; numOfHits++; break; } } if(numOfHits == locationCells.length) { result = "kill"; } System.out.println(result); return result; } }
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
What error?
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Compiles perfectly on my machine (JDK 1.6.0_03)
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: still this code gives compile time error
|
|
|