hi!i am trying to make a program that reads a whole file and then it prints the lines one by one.when i am trying to compile the program i am getting an error message that nextElement() symbol cannot be found.any ideas please?thank you!
import java.io.*;
import java.util.*;
public class token2
{
public static void main(String args[]) throws IOException{
String question;
StringTokenizer currentString;
BufferedReader InputData = new BufferedReader(new FileReader("c:/inputData.txt"));
while ((question = InputData.readLine()) != null){
currentString = new StringTokenizer(question,"?");
while (currentString.hasMoreElements())
System.out.println(question.nextElement());
}
}
}