SWE 619 Quiz Number 5
SWE 619 Quiz Number 5
1. Mark whether each line of code is a problem w.r.t. the immutability of class
IWantToBeImmutable.
Answer: We need an attack on the List object, since it is the only mutable component the
client can get access to.
https://cdn-uploads.piazza.com/paste/gxxicyrgsbf2x6/b17cc5f80a25dfb8722c74344207d63fd031539e0c8c642d020a5e075b0a99a6/quiz05.html 1/2
1/14/24, 8:01 AM SWE 619 Quiz Number 5
https://cdn-uploads.piazza.com/paste/gxxicyrgsbf2x6/b17cc5f80a25dfb8722c74344207d63fd031539e0c8c642d020a5e075b0a99a6/quiz05.html 2/2