I\'ve got to show Scanner inputs in a while loop: the user has to insert inputs until he writes \"quit\". So, I\'ve got to validate each input to check if h
Try:
while (scanner.hasNextLine()) {
System.out.println("Insert question code:");
String question = scanner.nextLine();
if(question.equals("quit")){
break;
}
System.out.println("Insert answer code:");
String answer = scanner.nextLine();
service.storeResults(question, answer); // This stores given inputs on db
}