When I run the application, the memory address prints to the screen. How do I get it to print the information? This is an example of what it is reading from the file.
Jason White
265325222
31
Computer Science
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
String lName = null, fName = null, uid = null, major = null;
int hours = 0, i = 0, ctr = 0;
Test[] students = null;
File input = new File("Enrollment.txt");
Scanner in;
students = new Test[30];
try
{
in = new Scanner(input);
while (in.hasNextLine() && i < students.length)
{
fName = in.next();
lName = in.nextLine();
uid = in.nextLine();
hours = in.nextInt();
in.nextLine();
major = in.nextLine();
students[i] = new Test();
System.out.println(students[ctr] = new Test());
i++;
}
ctr++;
}
catch (FileNotFoundException e)
{
System.out.println("File not found.");
}
}
}