Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# 1 . / / createarray. / / # 4 ) ( CHAP 7 ) ( 1 0 pts ) Create an array or ArrayList

#1.// createarray.// #4)(CHAP 7)(10 pts) Create an array or ArrayList of your superclass fromYou cannot hardcode the input -- have the user choose which subclass toand then create it and add it to array. Add at least 3 items to the Here in this main method, print out what is in the array!1111.// #5)(CHAP 11)(20 pts) Use a custom exception in your code -- for example,you add a characteristic and it is invalid, then let user know.Somethang LiKe Evatadvalue" the Lndicates the user put or example,that indicates the user put in anegative value11or something invalid).//HERE in this main method, print out an example of creating an instance//of one of the subclasses in #2 with an invalid value that causes theexceptionto be thrown (HINT: a good place to put this check is in theCONSTRUCTOR)Catch the exception HERE in the main method so your program doesn't endyet!To get full credit, you must catch the error and then let the userenter a//"good" value.11-////-....

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

10 0 1 10. X' = 0 10X 101

Answered: 1 week ago