Rewrite the following C++ class into Java, don't forget to put main into the Student class.
class Student {
std::string lname;
std::string fname;
int age;
double gpa;
Student(const std::string& lname, const std::string& fname, int age, double gpa);
std::string lname() const;
std::string fname() const;
int age() const;
double gpa() const;
friend std::ostream& operator<<(std::ostream& os, const Student& st);
};
int main(int argc, const char* argv[]);
public class Student
{
private String lName;
private String fName;
private int age;
private double gpa;
public Student(String lname, String fname, int age, double gpa);
public String lname();
public String fname();
public int age();
public double gpa();
public
String toString()
{
return
lName+ " "
+ f
Name+ " "
+ toString(
age) + " "
+
toString(gpa)
;
}
public
static
void
main(String[] args)
{
}
{
Get Answers For Free
Most questions answered within 1 hours.