How to remove specific element from ArrayList in Java

1 Answer

0 votes
import java.util.*;
   
public class MyClass {
    public static void main(String args[]) {
        ArrayList<Double> arrlist = new ArrayList<Double>();
          
        arrlist.add(79.12);
        arrlist.add(28.01);
        arrlist.add(47.98);
        arrlist.add(83.87);
        arrlist.add(99.31);
  
        System.out.println(arrlist); 
         
        arrlist.remove(47.98); 
 
        System.out.println(arrlist); 
 
    }
}
   
   
   
   
/*
run:
   
[79.12, 28.01, 47.98, 83.87, 99.31]
[79.12, 28.01, 83.87, 99.31]
   
*/

 



answered Apr 18, 2020 by avibootz

Related questions

2 answers 228 views
1 answer 121 views
4 answers 491 views
1 answer 186 views
1 answer 164 views
...