| NumStream.java |
| 1 | import java.io.*; |
| 2 | public class NumStream extends OutputStream { |
| 3 | public void write(int c) throws IOException { |
| 4 | // What goes here? |
| 5 | } |
| 6 | |
| 7 | public static void main(String[] args) { |
| 8 | NumStream ns = new NumStream(); |
| 9 | PrintWriter pw = new PrintWriter(new OutputStreamWriter(ns)); |
| 10 | pw.println("123456789 and ! and # "); |
| 11 | pw.flush(); // needed for anything to happen, try taking it out |
| 12 | } |
| 13 | } |
$ javac NumStream.java
|