Adding java code