How can I construct the array problem?

String Array Problem ~ Java Language.?

  • So, I have an assignment where I have to create a parallel array, except I cannot get my array to store my strings and feed them back out using a while loop. The point is to create an array that doesn't have a specified size and enter names into it until the user enters "quit". Then the names should appear on the screen. Every time I do this, I get stuck with an error message. Can someone please help me?

  • Answer:

    In Java, it is impossible to create an array that does not have a specified size. All Java arrays have a finite, specified size. If you need something that works like an array but does not have a specified size, that's what the ArrayList class is for. It would be easier to help if you could post the code you've written so far.

Silent at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.