English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am creating a program on Java that uses a file reader.The File file contains:
1_1
2_2
3_3
4_4
5_5
_=space
Using the file reader it should appear like that when the program is done...
May you please show the codes for this...thanks

2007-02-16 00:42:55 · 1 answers · asked by y0ger_19 4 in Computers & Internet Programming & Design

1 answers

import java.io.*;

public class Whatever{

public static void main(String[] args) throws IOException{
BufferedReader FileRadar = new BufferedReader (new FileReader("number.txt"));
String numbers;
while ((numbers = FileRadar.readLine()) != null ){
System.out.println(numbers);

}

}
}

2007-02-16 02:05:17 · answer #1 · answered by Geinius 3 · 0 0

fedest.com, questions and answers