adding java code