Java code