Assignment 1: Baseball Teams TeamID TeamName NbrOfYears TeamColors HomeCity Assignment 2: Only purpose: to be able to read a text file BaseballTeams.txt BufferedWriter say the size is 100 char say you already have 95 char in the buffer bw.write("Hello, World!") there is a flush command bw.flush(); String input = br.readLn(); will read up to the buffer size throws away the cr/lf Low-level readers FileReader wrapped with BufferedReader let us read one line at a time FileInputStream - a byte reader class FileInputStream fis = new FileInputStream("Address.txt") int fileSize = fis.available(); byte b[] = new byte[fileSize]; fis.read(b); String s = new String(b); textArea.setText(s); Multi-Threading several programs with the appearance of running simultaneously. processor is fed instructions from each in small quantities. Sockets and Web Programming end point in a line of communication handset is a socket dial tone is request for connection dial number - the other party picks up the phone lines are the lines of communication direction of communication goes mouthpiece to earpiece need to connect output of one to the input of the other Socket request a connection to a SocketListener this listener could do all the talking but this would tie it up so, the listener passes the connection to a new Thread, which is an independent process Changes to ReadAFile to make it a Thread and use Sockets: 1. Include import statement for java.net package 2. Implement the runnable interface 3. Move the code from the main method to the run method 4. Get rid of the main method 5. Create a constructor that accepts a Socket and assigns it to a class-level variable 6. Create a BufferedReader and a BufferedWriter to get the input and output from the Socket 7. Send the output to the BufferedWriter instead of the System.out