passing an integer to the java code instead of temp var