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
Get step-by-step solutions from verified subject matter experts
