Update java Code