Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please code in Java Requirements Write a Java process module (nameit Lab06.java) that meets the following requirements: The module will contain two methods (defined outside
Please code in Java
Requirements Write a Java process module (nameit Lab06.java) that meets the following requirements: The module will contain two methods (defined outside of the main method): someMethod and someMethod2. 1. 2. The main method will call someMethod a. Method someMethod will call method someMethod2. i. Method someMethod2 will throw an Exception, passing the String "This Exception thrown in someMethod2." b. Method someMethod will catch the Exception thrown in someMethod2, and will chain the Exception, adding the String message "This Exception caught in someMethod2, chained, and thrown as a new Exception. 3. The main method will catch the Exception and perform the following tasks: Output the entire message text to the System.err stream. Output the stack trace to the System.err stream. a. b. Submission Requirements Submit only your java code. Submit only the .java file; do not submit a .class file Expected Output Line numbers for your output will likely be different from these. The ellipses at the end indicate that the stack trace continues for some lines after the portion shown. This Exception caught in someMethod2, chained, and thrown as a new Exception. java.lang. Exception: This Exception caught in someMethod2, chained, and thrown as a new Exception. at Lab06.someMethod (Lab06.java:35) at Lab06.main (Lab06.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source) at java.lang.reflect.Method.invoke (Unknown Source)
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