Question
1). Add values( 8.2, 3.1, 4.9, 5.5, 8.3, 0.2 ) to dubs arraylist in main method. 2)pass dubs arraylist to test() method and call it
1). Add values( 8.2, 3.1, 4.9, 5.5, 8.3, 0.2 ) to dubs arraylist in main method.
2)pass dubs arraylist to test() method and call it in main method
At the end, print dubs in console.
test() method will remove the first two elements in an ArrayList of doubles (be careful, this is a little tricky! :-) )
Note: You should use remove() method to remove elements
------------------
import java.util.*;
class Main { //your main method code here public static void main(String[] args) { // Creating object of ArrayList
Step 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