Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTree House
19,702 PointsString cannot be convert to char
What do i wrong? i follow all the instruction from the video but i always get error when run the code
import java.util.Scanner;
class Prompter {
private Game game;
public Prompter(Game game) {
this.game = game ;
}
public boolean promptForGuess(){
Scanner scanner = new Scanner(System.in);
boolean isHit = false;
boolean isAcceptable = false;
do {
System.out.print("Enter a letter: ");
String guessInput = scanner.nextLine();
try {
isHit = game.applyGuess(guessInput);
isAcceptable = true;
} catch (IllegalArgumentException iae) {
System.out.printf(" %s please try again %n",
iae.getMessage());
}
} while (! isAcceptable);
return isHit;
}
public void displayProgress(){
System.out.printf("You have %d tries left to Solver: %s%n",
game.getRemainingTries(),
game.getCurrentProgress());
}
}
Bogdan Siverchuk
Courses Plus Student 1,707 PointsWhat error do you get?
Tree House
19,702 PointsTree House
19,702 Pointsi'am just typo lol