The problem is that I need to print objects' info including arrays which contain students' marks. But it throws rubbish instead. Also arrays must have 5 elements
public class Student {
Student(String fullname, int group, int marks[]){
this.fullname = fullname;
this.group = group;
this.marks = marks;
}//constructor
void display(){
System.out.println("Named: " + fullname + " | Group: " + group + " | Marks: " + marks);//prints out the objects
}
int group;
int marks[];
String fullname;//class fields
public static void main(String[] args){
Student Matthew = new Student("Whatever 1",14, new int[]{9, 6, 8, 4, 5});
Student John = new Student("Whatever 2",13, new int[]{4, 9, 5, 10, 7});
Student Max = new Student("Whatever 3",14, new int[]{7, 10, 8, 9, 9});//objects
Matthew.display();
John.display();
Max.display();
}
}