0
State the type of error and make it correct 1: switch (n>2) 2: System.out.println(100/0)
3 odpowiedzi
0
error: incompatible types: boolean cannot be converted to int
switch (n > 2) {
^
Exception in thread "main" java.lang.ArithmeticException: / by zero
0
👉Nikhil Yadhuvanshi👈
in switch case only (String, int) works not boolean or other
0
second case should throw a division by zero error ^^