help with ?
I have a project made and it has 2 classes one called student and one called main. It keeps throwing me an error on line 12 of the main class I have no idea why and i cant figure it out can someone help please. Thanks in advance
here is the student class
========================================================
import javax.swing.JOptionPane;
class student
{ //Opening brace for MyWorld class
private String studentName;//Holds first name
private Double studentGpa;//Holds last name
/*****
* Default constructor for MyWorld class prompts user for initial value
* of the object.
*****/
public student()
{//Opening brace for MyWorld()
String input;
studentName = JOptionPane.showInputDialog(null, "Enter your first name:",
"PracticeLab1", JOptionPane.QUESTION_MESSAGE);
input = JOptionPane.showInputDialog(null, "Enter GPA:",
"PracticeLab1", JOptionPane.QUESTION_MESSAGE);
studentGpa = Double.valueOf(input);
}//Closing brace for MyWorld()
/*****
* Overloaded constructor for MyWorld class that will set instant
* variables to values received by the parameter.
*****/
public student(String pStudentName, Double pStudentGpa)
{//Opening brace for MyWorld() overloaded
studentName = pStudentName;
studentGpa = pStudentGpa;
}//Closing brace for MyWorld() overloaded
/*****
* getFirstName() method will return the current value in firstName
*****/
public String getStudentName()
{//Opening brace for getFirstName()
return studentName;
}//Closing brace for getFirstName()
/*****
* getLastName() method will return the current value in lastName
*****/
public Double getStudentGpa()
{//Opening brace for getLastName()
return studentGpa;
}//Closing brace for getLastName()
/*****
* setFirstName() method will replace the current value in firstName
*****/
public void setStudentName(String pStudentName)
{//Opening brace for setFirstName()
studentName = pStudentName;
}//Closing brace for setFirstName()
/*****
* setLastName() method will replace the current value in lastName
*****/
public void setStudentGpa(Double pStudentGpa)
{//Opening brace for setLastName()
studentGpa = pStudentGpa;
}//Closing brace for setLastName()
/*****
* displayMessage() method displays the data in a message box
*****/
public void displayMessage()
{//Opening brace for displayMessage()
String output;
output = "Name: " + studentName +
"\nGPA: " + studentGpa;
JOptionPane.showMessageDialog(null, output, "PracticeLab1",
JOptionPane.INFORMATION_MESSAGE);
}//Closing brace for displayMessage()
/*****
* outputMessage() method displays the data using the
* System.out.println() method
*****/
public void outputMessage()
{//Opening brace for outputMessage()
System.out.println("Name: " + studentName);
System.out.println("GPA: " + studentGpa);
}//Closing brace for outputMessage()
} //Closing brace for MyWorld class
=======================================================
here is the main class
=======================================================
class PracticeLab1
{ //Opening brace for PracticeLab1 class
public static void main(String[] args)
{//Opening brace for main()
student stu1 = new student("sean", 4.0); //here is where it is throwing the error.
student stu2 = new student();
System.out.println(stu1.getStudentName() + " " +
stu1.getStudentGpa() + " " );
System.out.println();
stu2.outputMessage();
System.out.println();
stu2.outputMessage();
System.out.println();
stu1.displayMessage();
System.out.println("\n\nEnd of the PracticeLab1 application.");
}//Closing brace for main()
} //Closing brace for PracticeLab1 class
======================================================

