I want to store the questionmarks in a string because later I will be using string replace method to replace those question marks with a character the user guess. This is kind of a hangman game.
Scanner keyboard = new Scanner(System.in);
int length;
String originalString;
String option= "abcdefghijklmnopqrstuvwxyz";
String questionmarks;
System.out.println("Please enter a string");
originalString=keyboard.nextLine();
System.out.println(originalString);
length=originalString.length();
for(int i=1; i<=length;i++){
System.out.print("?");
}
}
?as the length of the string?for(int i=1; i<=length;i++){ questionmarks += "?"; }