I'm studying Java and am obviously very new to it. I have what appears to be a working application, however it doesn't produce any output to the console window as expected - it also doesn't give any errors which is baffling. I'm using Eclipse. I would greatly appreciate a second set of eyes to spot out what I'm doing wrong. There is some code in there from trying different approaches to get this to work - which I will delete later.
My question is: Why isn't my program producing output? As a follow up: Why isn't it producing some kind of error since it's not producing output?
I've researched for a couple of days now and the closest I found was this article which although it is similar but it doesn't really apply to this situation. System.out.print() doesn't send any output to Eclipse console. Why?
*Edited - shortened up the code & add comments on how to fix. I have 2 classes - Student and Roster.
Roster:
//** client class....*/
import java.util.ArrayList;
import java.util.Arrays;
public class Roster {
/* String copied from the instructions, adding info as the last item*/
static String[] students = {"1,John,Smith,John1989@gmail.com,20,88,79,59",
"2,Suzan,Erickson,Erickson_1990@gmailcom,19,91,72,85",
"3,Jack,Napoli,The_lawyer99yahoo.com,19,85,84,87"};
static ArrayList<Student> studentProfiles = new ArrayList<Student>();
public static void main(String[] args) {
//creating the arraylist - rather, converting a string of arrays to an Array list of student objects
{
for (int i = 0; i < students.length; i++) {
String component = students[i];
String[] terms = component.split(",");
String studentID = terms[0];
String firstName = terms[1];
String lastName = terms[2];
String emailAddress = terms[3];
String age = terms[4];
int grade1 = Integer.parseInt(terms[5]);
int grade2 = Integer.parseInt(terms[6]);
int grade3 = Integer.parseInt(terms[7]);
Student student = new Student(studentID, firstName, lastName, emailAddress, age, grade1, grade2, grade3);
studentProfiles.add(student);
}
}
}
//test just to generate output, didn't work. <-- Moving this inside the main generated the output I needed.
{
System.out.println(studentProfiles);
}
///
/// enter methods here
///
//
}
//other print all attempt
//-->> Put inside main
public static void print_all()
//-->> Put inside main
System.out.println(j);
`enter code here`
//-->> Put inside main
print_all();
print_invalid_emails();
print_average_grade(student);
remove("3");
remove("3");
//}
//}
}
}