Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. import java.io.FileNotFoundException;
  2. import java.io.File;
  3. import java.io.PrintWriter;
  4. import java.util.Scanner;
  5. /** tests readWrite method   */
  6. public class Lab11{
  7.     public static void main (String[] args) throws FileNotFoundException {
  8.       File telephoneNumbers = new File("telephone.txt");
  9.       File words = new File("samplewords.txt");
  10.      
  11.       int[] numbersArr = getPhoneNumberArray(telephoneNumbers);
  12.    }
  13.    
  14.    public static int[] getPhoneNumberArray(File inputFile) throws FileNotFoundException {
  15.       Scanner in = new Scanner(inputFile);
  16.       String tmp = "";
  17.       String[] out = new Str[1000];
  18.       while (in.hasNext()) {
  19.          tmp = in.next();
  20.          if (tmp.contains("604"))
  21.             continue;
  22.          else
  23.             System.out.println(tmp);
  24.       }
  25.    int[] x = {1,2,3};
  26.    return x;
  27.    }
  28.  
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement