pablosotol

Untitled

Oct 6th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2. import java.util.ArrayList;
  3.  
  4. public class Conjuntos{
  5.  
  6. protected ArrayList<Integer> numeros=null;
  7.  
  8. public Conjuntos(){
  9. numeros=new ArrayList <Integer>();
  10.  
  11. }
  12.  
  13. public Conjuntos union(Conjuntos c){
  14. ArrayList<Integer> numeros Aux=new ArrayList<Integer>();
  15. numeros Aux.addAll(numeros);
  16. for(Integer num: c.numeros){
  17. if(!numeros.contains(num)){
  18. numerosAux.add(num);
  19. }
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment