I have been trying to put a reset to this. So that you can continue forever until you hit enter (blank space) at the movie title selection.
It runs once and not more, can someone help me?
package stack;
import java.util.Scanner;
public class Stack {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (true) {
String temp = input.nextLine();
if (temp.length() > 0) {
info in = new info();
in.setTitel(temp);
in.filmnamn();
int nr[] = new int[3];
int sum = 0;
System.out.println();
for (int i = 0; i < nr.length; i++) {
System.out.print("Judge " + (i + 1) + " gives the movie: ");
nr[i] = input.nextInt();
sum += nr[i];
}
}
if (temp.isEmpty())
break;
}
}
}
This is the second class:
package stack;
public class info {
private String namn;
public void setTitel(String film) {
namn=film;
}
public String getTitel() {
return namn;
}
public void filmnamn() {
System.out.printf("Movie title: %s", getTitel());
}
}