Question
1. Define the exception class called TornadoException. The class should have two constructors including one default constructor. If the exception is thrown with the default
1. Define the exception class called TornadoException. The class should have two constructors including one default constructor. If the exception is thrown with the default constructor, the method getMessage should return "Tornado: Take cover immediately!" The other constructor has a single parameter, m, of int type. If the exception is thrown with this constructor, the getMessage should return "Tornado: m miles away; and approaching!" Write a Java program to test the class TornadoException 2. Suppose that you have the following vector objects: studentLastName = ["Smith", "Shue", "Cox", "Jordan"] studentFirstName = ["James", "Sherly", "Chris", "Eliot"] a. Write a Java statement that outputs the first name of the third student b. Write a Java statement that outputs the last name of the second student c. Write a Java statement that outputs the first name followed by the last name separated by a single blank space of the first student d. Write the necessary Java statements so that the first name and last name of Eliot Jordan are interchanged. e. Write a Java statement that changes the names James Smith and Sherly Shue to Sherly Smith and James Shue By changing the vector object studentLastName By changing the vector studentFirstName f. Write a for loop that prints all the students" names. 3. Write Java statements that will Create an UnorderedLinkedList Given List: 75 48 78 45 30 18 4 32 36 19
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