There are multiple ways to read a file into a variable.
One way would be by making use of the Scanner class to read the content of a file line by line. Here is a small code example reading a file from the filesystem, and printing the content, line by line. You can use this and instead of printing the content, append it in your queue and stack.
try {
File file1= new File("File1.txt");
Scanner fileReader= new Scanner(file1);
while (fileReader.hasNextLine()) {
String fileLine= fileReader.nextLine();
System.out.println(fileLine);
}
fileReader.close();
} catch (FileNotFoundException e) {
System.out.println("File could not be found.");
}