Question: Java 3. (10 points) Code Refactoring- The code below represents a fictitious Thing that tion, a num- mbies (totally made up), and a list of

Java
 Java 3. (10 points) Code Refactoring- The code below represents a

3. (10 points) Code Refactoring- The code below represents a fictitious Thing that tion, a num- mbies (totally made up), and a list of images. Carefully refactor the code without introducing y new classes, but to conform to the design specifications you have been learning this quarter. To save time, edit the existing classes below. Feel free to cross things out, draw arrows, etc. public class Thing f pubiie point 1ocation piiblic nt numzoombies ; public ArrayList pics: public Thing (Point location, int numZoombies) t num2 :-X this.location location: this.numZoombies = numZoombies; pics new ArrayList // space to maybe add code? Pie (int ndax) blie void public class Utilt public statse PImage getpic (Thing thing, int index) t return thing.pics/get (index); public static void getcloseTo (Thing thing1, Thing thing2) thing1.logation.move (thing2.location.x, thing2.location.y) public elass UseThings t public static void main (Stringt] args) f Thing julie new Thing (new Point (1,2), 7) Thing cookie = new Thing (new Point (-7, 15, 4); uylie vpri.getcloseTo(cookie) System.out.println("1oc:*+ gulie location) : more code here that is not shown

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!