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"); } }}
2 odpowiedzi
+ 6
"Exception", note the c after x
+ 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