Simple Function of Java