Question: import java.util.Random; public class Scores { private int[] list ; private int count; public Scores() { list = new int[50]; count = 0; } public

import java.util.Random;

public class Scores { private int[] list ; private int count; public Scores() { list = new int[50]; count = 0; } public Scores(int size) { list = new int[size]; count = 0; } public int size() { return count; } public boolean isEmpty() { return count == 0; } public void clear() { count = 0; } public int getFrequencyof(int num) { int freq = 0; for(int i=0;i= 0 && i < count) return list[i]; else throw new IndexOutOfBoundsException("Index "+i+" is invalid"); } public String toString() { String listStr = ""; for(int i=0;i

}

Rename this from Scores to ArrayBag

Modify the ArrayBag class so that it :

implements the Bag interface created in my last question

is a generic class.

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!