@Richard no, that's not the way to do it actually. Your naive solution would take a N^3 / 2 complexity.
A N^2 lgN complexity can be achieved if you first sort the array. A pair a[i] and a[j] is part of a triple that sums to 0 if and only if the value -(a[i]+ a[j]) is in the array(and not a[i] or a[j]). You need to sort the array, then do N (N - 1)/ 2 binary searches that each take time proportional to log N, for a total running time proportional to N^2 log N.
Here's an example in java : http://algs4.cs.princeton.edu/14analysis/ThreeSumFast.java