Question: Question 1 0 . 5 pts Consider the following implementation of a 1 D vector class:Is this class immutable? Answer yes / no , and
Question
pts
Consider the following implementation of a D vector class:Is this class immutable? Answer yesno and justify.No although the member variable is set to final, the constructor does not make a deep copy.Yes the member variable is set to final and that is sufficient.Yes the member variable is set to final and the constructor makes a deep copy.No the constructor always throws an exception before it is able to copy the data.Yes the constructor validates that there is no outside refeference to the data and throws an exception if there isNo this would not even compile since there is an assignment to a final variable in the constructor.
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
