Answered step by step
Verified Expert Solution
Question
1 Approved Answer
15 What changes need to be made to the main method to avoid the .compilation error (1 (1 ) public class C { static void
15 What changes need to be made to the main method to avoid the .compilation error (1 (1 ) public class C { static void ml (int x) throws Exception{ if (x ==0) throw new Exception(); else System.out.println("Correct"); } public static void main(String[] args) { m1(0); } Sol1: public static void main(String] args) { try {m1(0);} catch (Exception e) {}} Sol2: public static void main(String args) throws Exception{ m1(0);} Sol1 & Sol2 Sol3: public static void main(String] args) { m1(1); } all of the above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started