1234567891011121314151617181920212223242526 |
- import java.io.*;
-
- /**
- * Write a description of class FriendOfTextIO here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FriendOfTextIO
- {
- String fileName;
- public FriendOfTextIO() throws IOException {
- this.fileName = "hello.txt";
- }
-
- public void readSomeStuff() throws IOException {
- BufferedReader buff = TextIO.open(fileName);
- System.out.println(buff.readLine());
- System.out.println("This is an int: " + TextIO.readInt(buff));
- System.out.println("This is a char: " + TextIO.readChar(buff));
- System.out.println("This is a double: " + TextIO.readDouble(buff));
- System.out.println("This is a string: " + TextIO.readString(buff));
- }
-
- }
|