Question: An instance of the DiskModel class represents the ArrayList of Disk objects that have been placed on the board. You should add a field to

An instance of the DiskModel class represents the ArrayList of Disk objects that have been placed on the board. You should add a field to the class for this list.
You must implement 4 methods:
- A constructor that takes no parameters which initializes the empty ArrayList field
- A getDisks method which returns the ArrayList object
- A getNumDisks method which returns the number of Disks currently stored in the ArrayList
- An addDisk method which adds the disk parameter to the models ArrayList
My question is did I do it right...if not. How do I properly add an arraylist. And how to you use or put into the publlic void addDisk(Disk disk)
Disk.java DiskColor.java DiskModel.java X DisksApp.java Disks Panel.java 2 3e /** 4 * The model for the disk game 5 * which stores and ArrayList of Disks 6 */ 7 public class DiskModel { 28 // TODO: add fields. 9 100 /** 11 * Constructor. 12 * Creates empty ArrayList 13 */ 140 public DiskModel() { 0.15 ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
