Question: (Edgar) immutable. Assume the 3dPoint class is immutable. Some of these functions, by their nature, make the class mutable and should be removed completely to

(Edgar) immutable. Assume the 3dPoint class is immutable. Some of these functions, by their nature, make the class mutable and should be removed completely to make it immutable. Some others might make the class mutable, but it is possible to make them safe by implementing them carefully. Others are mostly safe in an immutable class. Determine which functions should be removed, which must be carefully implemented, and which are safe. public class 3 dShape\{ private 3dPoint points; public 3dShape(3dPoint points); 1/ Sets the point array member to the given point array public void setpoints(3dPoint points); // Returns the point aray member public 3dPoint getpoints(); // Returns the volume of the shape represented by the point public double getvolume(); // Stretches the shape by the percent specified in each direction public void stretch(double x, double y, double z ); } The function setPoints to make the class immutable. The function getPoints to make the class immutable. The function getVolume to make the class immutable. The function stretch to make the class immutable. (Edgar) Select the functions from the following list that could belong to an ADT. Remember that not all ADTs are immutable. (Hint: ask yourself if these methods belong in an idealistic ADT, i.e. one truly meeting the ADT design rule.) Account ADT 1/ Accepts an int and sets the account's ipening year to that setyear(int year) Bag ADT. 1/ Sets the max capacity of the bag to the given integer setMaxCapacity(int capocity) Queve ADT. 1/ Sets the queues internal Arraylist to the given Arraylist setContents (Arraylist contents) Queue ADT 1/ renove the leost recently added item dequeue() throws ArrayoutofBoundsException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
