I keep getting the output Student@42a57993. I would like to print out the results that is in students[0]
, I also would like to print out all the elements in the students array, Can someone help me and tell me whats wrong? i have one main method class which is the Client and another class which is Student.
public class Client {
public static void main(String[] args){
Student[] students = new Student[3];
students[0] = new Student();
students[0].StudentParticulars();
System.out.println((students[0]).toString());
}
}
import java.util.Scanner;
public class Student {
Scanner userInput = new Scanner(System.in);
String studName;
public void StudentParticulars(){
System.out.println("Enter Student name: ");
studName = userInput.nextLine();
}
}