При попытке компиляции выдает ошибки, скажи пожалуйста в чем проблема:
code Main
package lab3;
import java.util.ArrayList;
public class Main
{
public static void main(String[] args)
{
String query1 = "query1.txt";
String query2 = "query2.txt";
String query4 = "query4.txt";
String regex1 = "*69$";
String regex2 = "SPORT";
String regex4 = "*1{1}[0-9]{3}$";
StrProcess condition1 = new StrProcess(query1, regex1);
StrProcess condition2 = new StrProcess(query2, regex2);
StrProcess condition3 = new StrProcess(query4, regex4);
ArrayList<String> result1 = condition1.GetAll();
ArrayList<String> result2 = condition2.GetAll();
ArrayList<String> result3 = condition3.GetAll();
}
}
code StrProcess.java
package lab3;
import java.io.File;
import java.util.regex.Pattern;
import java.util.Scanner;
import java.util.ArrayList;
import java.io.FileNotFoundException;
public class StrProcess
{
private String filename, regex;
ArrayList<String> Str = new ArrayList<String>();
StrProcess(String filename, String regex)
{
try
{
File query = new File(filename);
Scanner reader = new Scanner(query);
while(reader.hasNextLine())
{
if(Pattern.matches(regex, reader.nextLine()))
{
Str.add(reader.nextLine());
}
}
}
catch(FileNotFoundException e)
{
System.out.println("File Not Found");
}
}
private void Sort()
{
}
public ArrayList<String> GetAll()
{
return(Str);
}
}