Question: Is the following class immutable?} import java.util.Date; public class Appointment { } private Date date; private String contact; public Appointment (Date date) { this.date date;
Is the following class immutable?}

import java.util.Date; public class Appointment { } private Date date; private String contact; public Appointment (Date date) { this.date date; this. contact = contact; = } public Date getDate() { return date; }
Step by Step Solution
There are 3 Steps involved in it
The class shown in the image is not immutable Here are the reasons why 1 The Date class in Java is mutable which means that the internal state of a Da... View full answer
Get step-by-step solutions from verified subject matter experts
