+ 2
Lesson 15 emotion doktor Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int emotion = scanner.nextInt(); switch(emotion) { case 1: System.out.println("You are happy!"); break; case 2: System.out.println("You are sad!"); break; case 3: System.out.println("You are angry!"); break; case 4: System.out.println("You are surprised!"); break; default: System.out.println("Unknown emotion!"); // your code goes here } } It says "Reach the end while file parsing" I dont know what i i did wrong
2 Réponses
+ 8
It means you're missing a closing bracket at the end.
Switch(){
...
}
+ 5
Thank you, i dont pay attention to the closing brackets. But i will in the future. Greetings from germany