The assignment is to :I have this code but it is giving me an error at/*
* 59. Write a class encapsulating the concept of a student, assuming a student
* has the following attributes: a name, a social security number, and a GPA
* (for instance, 3.5). Include a constructor, the assessors and mutators, and
* methods to String and equals. Write a client class to test all the methods
* in your class.
*/
Says that float = g is not a expect statement ";" and says soc = soc can't be to itself. I saw a way to fix this in my book but now i can't remember where to find what i should do to fix the soc= soc. Not sure at all how to fix the float = g;public Student(String n, int soc, float g) { name = n; soc = soc; float = g; }
Here is the entirety of the code
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package natashaepperson_chapter7_exercise_59; public class Student{ private String name; private int SSN; private Float GPA; public Student(String n, int soc, float g) { name = n; soc = soc; float = g; } public String getName() { return name; } // Create 2 more getter methods for SSN and GPA. protected void setName(String s) { this.name = s; } // Create two more setter methods for SSN and GPA. // I have it returning each item on its own line. @Override public String toString() { return(name + "\n" + SSN + "\n" + GPA); } public boolean equals(Student s) { if(!(s instanceof Student)) { return true; } return false; } }