0

java 14.1 problem

why am i getting an error 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.print("You are happy!"); break; case 2: System.out.print("You are sad!"); break; case 3: System.out.print("You are angry!"); break; case 4: System.out.print("You are surprised!"); break; default: System.out.print("Unknown emotion."); } } }

16th Dec 2022, 12:43 PM
Alex Williams
Alex Williams - avatar
1 Answer
+ 2
Where you got that last 2 output texts? Remove and rewrite same just. For any other, pls save code and share link..
16th Dec 2022, 1:50 PM
Jayakrishna 🇼🇳