import java.io.File;
import java.util.Scanner;


public class test2 {
public static void main(String args[]) {
try {
int i = 0;
String[] words = null;
// ファイルを指定し開く。
Scanner f = new Scanner(new File("データ.dat"));
// ファイルから1行分入力しコンソールへ出力。
while( f.hasNextLine() ) {
String s = f.nextLine();
words[i] = s;
++i;
}
while( i < words.length ) {
System.out.println(words[i]);
++i;
}
} catch( Exception e ) {
System.out.println("エラー");
}
}
}

ファイルは存在しますが
うまく動作せずに例外処理になってしまいます。
どうすればいいか教えてください。