0

Here is my Main method - calling Display. I am getting an error message, I don't know what I am missing. Any suggestions? (error message below the code)


public class DisplayStudent
{

public static void main(String[] args)
{

Student IDNGPA = new Student();
IDNGPA.Display();

}

}


Error message:

DisplayStudent.java:11: Display(int,double) in Student cannot be applied to ()
IDNGPA.Display();
^

public class Student
{
  private int studentID;
  private double studentGPA;
  
 public Student()
    {
	   studentID=100;
		studentGPA=3.0;
	 }
	 
	 
	public Student(int id, double gpa)
	   {
		  
	    studentID=id;
		 studentGPA=gpa;
		}
		
   public void AssignValues(int id, double gpa)
		 {
		  studentID=999;
		  studentGPA=3.75;
		 }
		 
  public void Display(int id, double gpa)
		   {
			 System.out.println("Student ID:"+" "+studentID);  
			 
			 System.out.println("Student GPA:"+" "+studentGPA); 
			 
			} 	
	}
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by peter_budo
0

Please edit your post and change it from CODE SNIPPED to FORUM THREAD. When you do so do not forget copy and paste code from code section to post section... (to make sure you got it right use preview option)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.