JAVA code