Question: Declare an Array of data type String as an instance variable Initialize the Array. Generate a random number and use the random number as the
- Declare an Array of data type String as an instance variable
- Initialize the Array. Generate a random number and use the random
number as the Array size. You do not need to add elements to the Array
when initializing it - Have a method that takes a parameter and adds the parameter to the
Array. A suitable error message must be given if the Array is full. - Have a method that sorts the Array.
- Have a method that prints all of the elements in the Array.
Using the methods that you wrote, you must do the following in the main
method:- An object of type QuestionThree
- Use the method that you wrote to add at least five elements to the
Array.
ch oloments in the Array. - Use the method you wrote to print all of the elements in the
- Use the method you wrote to sort the Array.
- Use the method you wrote to print all of the elements in the Array again
to demonstrate that the sort method you wrote successfully sorted the
Array.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
