Skip to content
Snippets Groups Projects
Commit fd8638be authored by Dominic Daniel Krämer's avatar Dominic Daniel Krämer
Browse files

implemented basic FileReader functions in main.java

parent a52098c0
No related branches found
No related tags found
1 merge request!6Dominicsbranch
1 + xy^2 - (31 * x)y
\ No newline at end of file
1 + xy^2 - (31 * x)y
1 + x^2 - (3 * x)
2x + 0,5x^2 - 1
\ No newline at end of file
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
public class Application {
public static void main(String[] args) {
BufferedReader reader;
String datapath = "expressions.txt";
try {
System.out.println("Reading the file:");
reader = new BufferedReader(new FileReader(datapath));
String line = reader.readLine();
while(line != null) {
System.out.println(line);
line = reader.readLine();
}
System.out.println();
reader.close();
}
catch (IOException e ) {
e.printStackTrace();
}
//List with a fitting String to be parsed into multiple tokens
List<String> test = Arrays.asList("1 + xy^2 - (31 * x)y");
//Iterates through every String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment