Question: the bolded areas are where I keep getting errors in the code. if you have a better code option please help with this question. I
the bolded areas are where I keep getting errors in the code. if you have a better code option please help with this question.
I need this In Java FX and i Want it to work in Eclipse.
Design a new parameterized ArrayList called NuArrayList
public
public
This class NuArrayList must NOT have a main method.
Create a class to demonstrate the use of your NuArrayList class. This class will not be used by the entire company. It should not be in the nusoft.utils package. Put it in an appropriate package. This class will
1. generate at least 25 random java.lang.Integer objects, 2. add the integer objects to a NuArrayList object 3. display the contents of the NuArrayList object 4. display the minimum and maximum elements it contains 5. Repeat steps 1 - 4 using random java.lang.Character objects 6. Repeat steps 1 - 4 using random java.util.Date objects
package com.example;
import java.util.Date;
import java.util.Random;
import nusoft.utils.NuArrayList;
public class NuArrayListDemo {
public static void main(String[] args) {
// Create a new NuArrayList
NuArrayList
// Add 25 random Integer objects to the list
Random rand = new Random();
for (int i = 0; i < 25; i++) {
int num = rand.nextInt(100);
intList.add(num);
}
// Display the contents of the list
System.out.println("Integer List: " + intList);
// Display the minimum and maximum elements in the list
System.out.println("Minimum: " + intList.min());
System.out.println("Maximum: " + intList.max());
// Create a new NuArrayList
NuArrayList
// Add 25 random Character objects to the list
for (int i = 0; i < 25; i++) {
char ch = (char)(rand.nextInt(26) + 'a');
charList.add(ch);
}
// Display the contents of the list
System.out.println("Character List: " + charList);
// Display the minimum and maximum elements in the list
System.out.println("Minimum: " + charList.min());
System.out.println("Maximum: " + charList.max());
// Create a new NuArrayList
NuArrayList
// Add 25 random Date objects to the list
long now = System.currentTimeMillis();
for (int i = 0; i < 25; i++) {
long time = rand.nextLong() % now;
Date date = new Date(time);
dateList.add(date);
}
// Display the contents of the list
System.out.println("Date List: " + dateList);
// Display the minimum and maximum elements in the list
System.out.println("Minimum: " + dateList.min());
System.out.println("Maximum: " + dateList.max());
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
