Question: Please code the following in: JAVA! Please use many comments so I can understand. Full points will be awarded, thanks in advance! Some classes are

Please code the following in: JAVA!

Please use many comments so I can understand.

Full points will be awarded, thanks in advance!

Please code the following in: JAVA! Please use many comments so Ican understand. Full points will be awarded, thanks in advance! Some classes

Some classes are unusual in that once created & initialized via a constructor, they never change their internal data for the lifetime of the object. The term mutable (think editable) is used to describe classes whose internal state (data) can change as the object is used. An Immutable Object is an object that once defined, never alters or changes its internal data - the java.lang.String class is one example of this. Immutability is like a "read-only" characteristic; the data may be observed and "gotten" but is never changed or "written to". We'll discuss privacy leaks shortly in class, but it's worth noting here that since an Immutable object can't be changed, we don't have to worry about privacy leaks across getter/setter boundaries when those that do the getting/setting cannot change your object. Think of this as similar to a "public static" data item - we don't worry about making it private, since there is no damage an external client can do to these data items. We'll build a String class here that is really just a CharList or IntList variation that we've seen before. Start by defining a new class called "CharList" and implement the data and method members below Class Invariants .Ask the instructor if you may assume no string will grow beyond 100 characters in this lab Data An array to store characters. . Should we make this data private? An integer variable used to track the number of characters Methods . public CharList) . public CharList(String startStr); //use string to set up internals . public CharList(CharList other); //copy c'tor; be sure to check for null input . public void add(char next); //Could we make this so it dynamically grows to accommodate more than 100 elements? public char get(int index); public String toString( o Return a string that is the concatenated result of combining every character in your char array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!