W
wilfrid100
Guest
Kods:
valsts statisko Object [] [] readTextFile ()
throws FileNotFoundException, IOException
(
mēģinājums
(
BufferedReader in = new BufferedReader (
jauns FileReader ( "C: / Documents and Settings / Seng / Desktop / testfile / assignment_matrix.txt"));Sarakstā sarakstu = new ArrayList ();
String text;
while ((text = in.readLine ())! = null)
(
Object [] out = text.split ( ""); / / atdalītas ar "atstarpes"
for (int index = 0; indekss <out.length; index )
out [index] = Integer.parseInt ((String) to [index]); / / problēma
list.add (out);
)Object [] [] izlaide = (Object [][]) list.toArray (jauns Object [0] [0]);
atpakaļ produkcijas;
)catch (IOException exc)
(
exc.printStackTrace ();
)atpakaļ jauns Object [0] [0];
)
valsts statisko Object [] [] readTextFile ()
throws FileNotFoundException, IOException
(
mēģinājums
(
BufferedReader in = new BufferedReader (
jauns FileReader ( "C: / Documents and Settings / Seng / Desktop / testfile / assignment_matrix.txt"));Sarakstā sarakstu = new ArrayList ();
String text;
while ((text = in.readLine ())! = null)
(
Object [] out = text.split ( ""); / / atdalītas ar "atstarpes"
for (int index = 0; indekss <out.length; index )
out [index] = Integer.parseInt ((String) to [index]); / / problēma
list.add (out);
)Object [] [] izlaide = (Object [][]) list.toArray (jauns Object [0] [0]);
atpakaļ produkcijas;
)catch (IOException exc)
(
exc.printStackTrace ();
)atpakaļ jauns Object [0] [0];
)