Question: Can you please explain and solve this question step hy step public class Program2 { public static void main(String[] args) { int c = 0;
public class Program2 { public static void main(String[] args) { int c = 0; while(true){ try{ switch (C){ case 0: case 1: case 2: c=c+3; throw new Exception("First"); case 3: case 4: throw new Exception("Second"); case 5: throw new Exception("Third"); default: System.out.println("c="+c+" and Fourth"); } if(c>5) break; 3 catch(Exception ex){ System.out.println("c="+c+" and "tex.getMessage()); c=c+2; } 3 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
