Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package assignment1;
- import java.util.StringTokenizer;
- import java.io.*;
- /**
- *
- * @author User
- */
- public class NewClass {
- public static void main(String[] args) throws FileNotFoundException, IOException {
- String sender="Alice";
- int te=0;
- String[] text=new String[6];
- try {
- BufferedReader bf = new BufferedReader(new FileReader("test.txt"));
- String line;
- while ((line = bf.readLine())!= null){
- StringTokenizer tz=new StringTokenizer(line);
- while(tz.hasMoreTokens()){
- text[te]=tz.nextToken();
- te++;
- System.out.println(""+text[te]);
- }
- }
- }
- catch (Exception e){
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement