Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't understand what is going on in this code in Java, comments within the code would help a bunch. Exceptions Activity public class ExceptionActivity

I don't understand what is going on in this code in Java, comments within the code would help a bunch. image text in transcribed

Exceptions Activity public class ExceptionActivity { public void doThis() { try! Scanner scanner = new Scanner(System.in); System.out.println("Enter two integers separated by space"); int x = scanner.nextInt(); int = scanner.nextInt(); int z = x/y; System.out.println(z); } catch (ArithmeticException e) { System.out.print("A"); 1 catch (RuntimeException e) { System.out.print(" "); 3 catch (Exception e) { System.out.print("C"); } finally System.out.println("D"); 1 1 public void doThis (int[] nums, int val) { try { for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago

Question

=+differences in home- and host-country costs of living?

Answered: 1 week ago

Question

=+derived from the assignment will balance the costs?

Answered: 1 week ago