Question: Analyze the following code:public static void main ( String [ ] args ) System.out.println ( Welcame to Java ) ; } class MyException extends
Analyze the following code:public static void mainString args System.out.printlnWelcame to Java";
class MyException extends Error
The program has a compile error.
You should not declare a class that extends Error, because Error raises a fatal error that terminates the program.
You declared an exception in the main method, but you did not throw it
You cannot declare an exception in the main method.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
