some code samples, various examples of simple modeling ideas and some minor algorithms.

FriendOfTextIO.java 750B

1234567891011121314151617181920212223242526
  1. import java.io.*;
  2. /**
  3. * Write a description of class FriendOfTextIO here.
  4. *
  5. * @author (your name)
  6. * @version (a version number or a date)
  7. */
  8. public class FriendOfTextIO
  9. {
  10. String fileName;
  11. public FriendOfTextIO() throws IOException {
  12. this.fileName = "hello.txt";
  13. }
  14. public void readSomeStuff() throws IOException {
  15. BufferedReader buff = TextIO.open(fileName);
  16. System.out.println(buff.readLine());
  17. System.out.println("This is an int: " + TextIO.readInt(buff));
  18. System.out.println("This is a char: " + TextIO.readChar(buff));
  19. System.out.println("This is a double: " + TextIO.readDouble(buff));
  20. System.out.println("This is a string: " + TextIO.readString(buff));
  21. }
  22. }