Question
Write a method that has 4 input parameters and uses the first (int) parameter to select one of the three (String) parameters. - Name the
Write a method that has 4 input parameters and uses the first (int) parameter to select one of the three (String) parameters.
- Name the class StringChooser
- Method name chooseString().
- Method is static (does not use object data).
- Method has 4 parameters of type int, String, String, String.
- Method returns a String value.
- The method's return value is:
- if int parameter is less than 0, return first String parameter
- if int parameter is equal to 0, return second String parameter
- if int parameter is greater than 0, return third String parameter
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