Manbearpig101, on 27 March 2011 - 03:33 PM, said:
this code is wrong i think. because prgram give an error




Posted 27 March 2011 - 03:44 PM
Posted 27 March 2011 - 03:47 PM
This post has been edited by javabeginner18: 27 March 2011 - 03:48 PM
Posted 27 March 2011 - 03:50 PM
Posted 27 March 2011 - 06:46 PM
import java.io.*;
public class CharArray {
public static void main(String[] args) {
StringBuffer contents = new StringBuffer();
BufferedReader reader = null;
int nbRow = 0;
try {
reader = new BufferedReader(new FileReader("input.txt"));
String text;
// repeat until all lines is read
while ((text = reader.readLine()) != null) {
nbRow++;
contents.append(text).append(System.getProperty("line.separator"));
}
}
catch(IOException e) {}
char[][] digit = new char[nbRow][];
String[] line = contents.toString().split(System.getProperty("line.separator"));
for(int i = 0; i < line.length; i++)
digit[i] = line[i].toCharArray();
}
}
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
