Question: As we know Java arrays are not dynamically expandable at run time. Write a Java program to read unlimited number of inputs from console (each

As we know Java arrays are not dynamically
expandable at run time. Write a Java program to read unlimited number of
inputs from console (each is separated by the carriage return), store them
in an array of Strings and print them. Program should terminate after you
input an empty string. You may need to have the following methods in
your program.
static String [] getStrings() this will read unlimited number of
strings and return them as an array of strings.
static String [] resize( String [] array, int newSize) this
supporting method may need to be called inside getStrings to resize the
array as needed.
Note: For this program, you should use regular arrays. Do not use any
other data structure.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!