Answers for "union in java"

0

set union java

set1.retainAll(set2); // Intersection
Posted by: Guest on October-21-2020
0

set union java

set1.addAll(set2); // Union
Posted by: Guest on October-21-2020
0

how to find union in java

public static void findUnion(int arry1[],int arry1size,int arry2[],int arry2size){
    	
    	HashSet<Integer> hs=new HashSet<Integer>();
    	
    	for(int i=0;i<arry1size;i++){
    		hs.add(arry1[i]);
    	}
    	for(int i=0;i<arry2size;i++){
    		hs.add(arry2[i]);
 
    	}
    	System.out.println(hs);
    	
    }
Posted by: Guest on September-12-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language