Making use of class Results shown below, repeat the above program, this time writing/reading objects of class

Question:

Making use of class Results shown below, repeat the above program, this time writing/reading objects of class Result. (When displaying the names and marks that have been read, of course, you must make use of the methods of class Result.) Once again, redirect initial input to come from your text file.

class Result implements java.io.Serializable
{
private String surname;
private int mark;
public Result(String name, int score)
{
surname = name;
mark = score;
}
public String getName()
{
return surname;

}
public void setName(String name)
{
surname = name;
}
public int getMark()
{
return mark;
}
public void setMark(int score)
{
if ((score>=0) && (score<=100))
mark = score;
}
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: