Given a set , find XOR of the XOR 's of all subsets. | Java program to find XOR of XOR 's of all subsets ; Returns XOR of all XOR 's of given subset ; XOR is 1 only when n is 1 , else 0 ; Driver code
import java . util . * ; class GFG { static int findXOR ( int Set [ ] , int n ) { if ( n == 1 ) return Set [ 0 ] ; else return 0 ; } public static void main ( String arg [ ] ) { int Set [ ] = { 1 , 2 , 3 } ; int n = Set . length ; System . out . print ( " XOR ▁ of ▁ XOR ' s ▁ of ▁ all ▁ subsets ▁ is ▁ " + findXOR ( Set , n ) ) ; } }