added java code