Question
I'm trying to draft two constructors (one single parameter and one double parameter listed below): public CustomerException(msg:String) : CustomerException ---- Single-parameter constructor used for initial
I'm trying to draft two constructors (one single parameter and one double parameter listed below):
public CustomerException(msg:String) : CustomerException ---- Single-parameter constructor used for initial throw of exception type
public CustomerException(msg: String, cause: Throwable) : CustomerException ----- Two-parameter constructor for use when chaining the exception type
The attributes for this code are as follows:
String custNumber: 7 digits in length, greater than 10,000
String tin: 9 digits in length
String last: Null or blank values not permitted
String first: Null or blank values not permitted
int margin: negative values not permitted
boolean drip:
boolean futures:
The following exceptions will be thrown when the items entered are outside the set values of the aforementioned attributes.
EXPECTED RESULTS
CustomerException thrown The margin value must be zero or greater. Offered values: Customer number: 1000002 Tax Id: 321654987 Last Name: Blackwood First Name: Charlotte Margin: -1 DRIP: false Futures: false
|
CustomerException thrown First name must not be null or blank. Offered values: Customer number: 2009999 Tax Id: 951263874 Last Name: MissingFirst First Name: Margin: 50000 DRIP: true Futures: false |
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