Wrote java code