Declare an Array of data type String as an instance variable Initialize the Array. Generate a random
Fantastic news! We've Found the answer you've been seeking!
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 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.
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date: