0

Showing [cannot find sysmbol] please solve!

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int choice = scanner.nextInt(); String[] categories = {"PCs", "Notebooks", "Tablets", "Phones", "Аccessories"}; //complete the code try { System.out.print(categories[choice]); } catch(Exeption e){ System.out.print("Wrong Option"); } }}

24th Apr 2023, 2:13 AM
Mustakim Rahman
Mustakim Rahman - avatar
2 odpowiedzi
+ 6
"Exception", note the c after x
24th Apr 2023, 2:20 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 3
seems to have a typo in the catch block. The catch block is catching the wrong exception type. Instead of "Exeption", it should be "Exception". https://code.sololearn.com/cN4rWX1SV6i2/?ref=app
24th Apr 2023, 3:35 AM
Sadaam Linux
Sadaam Linux - avatar