Driver program to test above function
public static void main ( String [ ] args ) { int a [ ] [ ] = { { 1 , 2 , 3 , 4 } , { 5 , 6 , 7 , 8 } , { 1 , 2 , 3 , 4 } , { 5 , 6 , 7 , 8 } } ; long sum = getBoundarySum ( a , 4 , 4 ) ; System . out . println ( " Sum ▁ of ▁ boundary ▁ elements " + " ▁ is ▁ " + sum ) ; } }