output result for java