Driver code
public static void main ( String [ ] args ) { int arr [ ] = { 2 , 3 , 4 , - 2 , 6 , 8 , 9 , 11 } ; Arrays . sort ( arr ) ; SumOfPairs sp = new SumOfPairs ( ) ; sp . pairedElements ( arr , 6 ) ; } }