Ich versuche grad zu verstehn, wie der Scanner in Java funktioniert, habs eigentlich auch verstanden, aber jetzt hab ich ein Problem. Wenn ich diesen code eingebe kommt: "cannot find symbol - method nextChar()"
Java:
import java.util.Scanner;
public class Taschenrechner
{
public static void main(String[] args)
{
int x,y;
char z;
Scanner scanner = new Scanner(System.in);
System.out.println("Gib eine Rechnung ein!");
x = scanner.nextInt();
y = scanner.nextInt();
z = scanner.nextChar();
if(z == '+') System.out.println(x + y);
if(z == '-') System.out.println(x - y);
if(z == '*') System.out.println(x * y);
if(z == '/') System.out.println(x / y);
else System.out.println("Keine gültige Rechnung");
}
}