aspose file tools
The moose likes Beginning Java and the fly likes i am still getting compile time error in this program plz give me solution Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

i am still getting compile time error in this program plz give me solution

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;
}
}
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56153
    
  13

Please do not post the same question more than once.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i am still getting compile time error in this program plz give me solution
 
Similar Threads
still this code gives compile time error
Enhanced for loop
Beginner Ques. from Head Start Java book
HeadFirst SimpleDotCom compile
Getting 6 errors with the use of result(noob)