Hallo, ich bin noch ziemlich am Anfang von Java. Also ein Einsteiger.
Kann mir jemand helfen? Ich weiß, auch nach längere Recherche nicht, was ich falsch mache.
Kann mir jemand helfen? Ich weiß, auch nach längere Recherche nicht, was ich falsch mache.
Java:
import java.util.Scanner;
public class TEST {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("Alter: ");
int userinput = input.nextLine ();
if(userinput < 16) {
System.out.println("Kein Alkohol erlaubt");
}
else if (userinput >16) {
System.out.println("Alkohol erlaubt");
}
}
}