adding Java code