Added Java examples #29-32 and C++ examples #22-28