Question: 5. a. Write a program that calls a method that throws an exception of type ArithmeticExcepton at a random iteration in a for loop. Catch

 5. a. Write a program that calls a method that throws

5. a. Write a program that calls a method that throws an exception of type ArithmeticExcepton at a random iteration in a for loop. Catch the exception in the method and pass the iteration count when the exception occurred to the calling method by using an object of an exception class you define. b. Write a Java program to create a super class Transport having members Brand and Sellingprice. Derive 2 different classes Micro (members - distance) and Truck (members weight). Accept the information for n vehicles and display the information in appropriate form. While taking data, ask the user about the type of transport first

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!