How to find subset using integer array

how to find subset using integer array

if you want to print the elements of the subset then use a string or an arraylist to store them

i have to find the sum of them