Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- public class Conjuntos{
- protected ArrayList<Integer> numeros=null;
- public Conjuntos(){
- numeros=new ArrayList <Integer>();
- }
- public Conjuntos union(Conjuntos c){
- ArrayList<Integer> numeros Aux=new ArrayList<Integer>();
- numeros Aux.addAll(numeros);
- for(Integer num: c.numeros){
- if(!numeros.contains(num)){
- numerosAux.add(num);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment