New Java example for QueryCondition, minor fixes for C++

Added the Java example, and made minor fixes in the comments of the C++
example.