Question: I humbly request an explination and why did it keep continuing giving the shoudn't the output only be 1:Lower and the rest is ignored due
1 public class nunclass public statio void main(String[] args) { Int() * = {1, 2, 0, 10); for (int y : x) { try { 1+ (y > (x.length / 2)) throw now Exception("Higher"); etso throw new Exception("Lower"); } catch (Exception ex) { System.out.println(y + ":" + ex.getMessage()); //end of loop /end of main 0}} 10 11 12 13 14 15 I Run: numclass /Library/Java/JavaVirtual Machines/jdk-15.Jdk/Contents/Home/bin/java -jaw 1:Lower 7: Higher @: Lower 10:Higher IA EDE Process finished with exit code @
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
