The following program demonstrates how to Find the Sum of Array Elements at Non-Prime Index in Java.

Basically, a prime number is the one that is divided by only 1 or itself. So, if an array has elements at the index values 0,1,2,3,4,5,6,7,8,9,10,11,12,13 then the prime index are 2,3,5,7,11, and 13. The non-prime indexes are 0, 1, 4, 6, 8,9, 10, and 12. So in this program, first we find whether the current index is prime or non-prime. If it is non-prime, then we include the corresponding element in the sum.