Question: public class Student { public String id; private String name; private volatile boolean active; private ArrayList exams; public Student ( String id , String name
public class Student
public String id;
private String name;
private volatile boolean active;
private ArrayList exams;
public StudentString id String name
this.id id;
this.name name;
this.active false;
this.exams new ArrayList;
public synchronized String getName
return this.name;
public synchronized void registerModule module
module.addStudentthisid;
this.active true;
public synchronized void addExamExam exam
this.exams.addexam;
public synchronized ArrayList getTranscript
return new ArrayListthisexams;
public void printTranscript
if this.active
System.out.printlncurrently inactive;
synchronizedthis
System.out.printlnStudent this.name;
for Exam e: this.exams
System.out.printlnetoString;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
