I want to assign strings to the student constructor's parameters based on what is typed into the JOptionPane : I want to assign strings to the student constructor's parameters based on what is typed into the JOptionPane input boxes . I have the user inputted information set to go to a variable but when I try and use those variables as my Parameters for the constructor I get an error. 

This is the Main

    import javax.swing.JOptionPane;
    public class main
    {
        public static void main (String [] args)
        {
    
     String nameinput ;
     String gradeinput ;
     String resourceinput ;
     String whatMissinginput;
    
     int infoComformation = 1;
   
     if  ( infoComformation == 1)
    { nameinput =JOptionPane.showInputDialog("What is the students name");
      gradeinput =JOptionPane.showInputDialog("What is the students grade");
      resourceinput =JOptionPane.showInputDialog("What resource are you pulling the child out for ");
      whatMissinginput =JOptionPane.showInputDialog("What subject are you pulling the child out of ");
      infoComformation = JOptionPane.showConfirmDialog (null, "Is this the correct informtion \n " 
                                             +"Name = "  + nameinput +  "\n"  
                                             + "Grade = " + gradeinput + "\n"
                                             +"Resouce = " + resourceinput + "\n"
                                             +"Subject Missing = " + whatMissinginput );
                                            }
    else
     if (infoComformation == 0)
     //THIS IS WHERE THE PROBLEM IS 
    {student pupil = new student( nameinput, gradeinput ,resourceinput,whatMissinginput);  
      }                        
   
          
      }
      }



Here is the Constructor Class



    import javax.swing.JOptionPane;
    public class student
    {

    
    
        public String studentinfo  (String nameinput, String gradeinput , String             resourceinput,String whatMissinginput )
     {
         String name ="" ;
        String grade= "";
        String resource ="";
         String whatMissing="";

  
     name=nameinput;
     grade=gradeinput;
     resource=resourceinput;
     whatMissing=whatMissinginput ;
    
     return name+grade+resource+whatMissing;
  


    }
    }

What do I Do?