Question: Part A: Become familiar with the Java API exception handling classes. .Create a new java project and add a class called StrTester. Add a main

 Part A: Become familiar with the Java API exception handling classes..Create a new java project and add a class called StrTester. Adda main method. For part A of this exercise, you will be

Part A: Become familiar with the Java API exception handling classes. .Create a new java project and add a class called StrTester. Add a main method. For part A of this exercise, you will be writing code in a main method to intentionally throw the following runtime exceptions 1. ArithmeticException 2. NumberFormatException (extends from llegalArgumentException) 3. ArraylndexOutOfBoundsException (extends from IndexOutOfBoundsException) 4. NegativeArraySizeException 5. InputMismatchException (extends from NoSuchElementException) 6. NullPointerException 7. And one Error OutOfMemoryError public static void main(String[] args) Scanner scan new Scanner(System.in) System.out.print('Enter an integer: ") int x scan.nextInt0: int result0; Enter an integer: O Exception in thread "main" java lang ArithmeticException: /by zero at week9.Str Tester main(Str Tester.java:16) result 5/x; System.outprintln("result" result): Part A: Become familiar with the Java API exception handling classes. .Create a new java project and add a class called StrTester. Add a main method. For part A of this exercise, you will be writing code in a main method to intentionally throw the following runtime exceptions 1. ArithmeticException 2. NumberFormatException (extends from llegalArgumentException) 3. ArraylndexOutOfBoundsException (extends from IndexOutOfBoundsException) 4. NegativeArraySizeException 5. InputMismatchException (extends from NoSuchElementException) 6. NullPointerException 7. And one Error OutOfMemoryError public static void main(String[] args) Scanner scan new Scanner(System.in) System.out.print('Enter an integer: ") int x scan.nextInt0: int result0; Enter an integer: O Exception in thread "main" java lang ArithmeticException: /by zero at week9.Str Tester main(Str Tester.java:16) result 5/x; System.outprintln("result" result)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!