Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java String Array without implicit size

Name: Anonymous 2008-02-19 7:36

hey people

I'm trying to get strings from a text inside a String array without implicit size

as if: cycle where method reads a line then stores into the array

Name: Anonymous 2008-02-19 16:03

List<String> readText(BufferedReader in) throws IOException {
  List<String> l = new ArrayList<String>();
  String s;
  while((s = in.readLine()) != null) l.add(s);
  return l;
}

Is this what you mean? Use (String[])l.toArray() if you really need an array for some reason.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List