Question
Please Explain. Thanks! TestNumArrayList.Java package hw8; public class TestNumArrayList { public static final int arrSize = 10; public static void main(String[] args) { Integer[] iarr
Please Explain. Thanks!
TestNumArrayList.Java
package hw8;
public class TestNumArrayList { public static final int arrSize = 10;
public static void main(String[] args) { Integer[] iarr = new Integer[arrSize]; for (int i = 0; i (iarr); System.out.println("The Integer NumArrayList: " + iArrLst); NumArrayList dArrLst = new NumArrayList(); for (int i = 0; i
NumArrayList.java
// To use or not as you wish package hw8;
import java.util.ArrayList;
public class NumArrayList{
private ArrayList L;
public NumArrayList() {
} // Create a new NumArrayList, initializing it with the parameter public NumArrayList(T[] initValues) { } public void add(T elem) { } // Uncomment out and write this method // There isn't a reasonable stub I can put in it //public T get(int index) { // //}
// Return the String representation of the NumArrayList public String toString() { // replace this with the correct implementation return ""; }
// Multiply the NumArrayList by an Integer value public NumArrayList iMult(Integer val) { // replace this with the correct implementation NumArrayList iItem = new NumArrayList(); // Put your code to fill the NumArrayList iItem here return iItem; } }
Assignment For this assignment you will write a class NumArrayList which is a generic type for an ArrayList that contains numeric values. I have provided a template for the class found in the NumArrayList.java file posted to D2L. You should begin your assignment by downloading that template The NumArrayList class has a single private instance variable L of type ArrayListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started